def award_badge(config, count, user):
 slug = config.get(count)
 if (not slug):
  return
 badge_class = BadgeClass.get_badge_class(slug=slug, issuing_component='openedx__course', create=False)
 if (not badge_class):
  return
 if (not badge_class.get_for_user(user)):
  badge_class.award(user)

def award_badge ( config , count , user ) : slug = config . get ( count ) if ( not slug ) : return badge_class = BadgeClass . get_badge_class ( slug = slug , issuing_component = 'openedx__course' , create = False ) if ( not badge_class ) : return if ( not badge_class . get_for_user ( user ) ) : badge_class . award ( user )
given one of the configurations for enrollments or completions .