'Returns RegistrationCodeRedemption object if registration code
has been used during the course enrollment else Returns None.'

@classmethod
def registration_code_used_for_enrollment(cls, course_enrollment):

    reg_codes = cls.objects.filter(course_enrollment=course_enrollment).order_by('-redeemed_at')
    if reg_codes:
        return reg_codes[0]
    return None
