@receiver(ENROLL_STATUS_CHANGE)
def award_badge_on_enrollment(sender, event=None, user=None, **kwargs):
 if (badges_enabled and (event == EnrollStatusChange.enroll)):
  award_enrollment_badge(user)

@ receiver ( ENROLL_STATUS_CHANGE ) def award_badge_on_enrollment ( sender , event = None , user = None , ** kwargs ) : if ( badges_enabled and ( event == EnrollStatusChange . enroll ) ) : award_enrollment_badge ( user )
awards enrollment badge to the given user on new enrollments .