Skip to content

Commit

Permalink
Merge pull request #482 from edly-io/alisalman/fix-badgr-creation
Browse files Browse the repository at this point in the history
Alisalman/fix badgr creation
  • Loading branch information
Ali-Salman29 authored Jan 5, 2024
2 parents d77ea24 + 3aaa2c0 commit ca36adf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lms/djangoapps/badges/backends/badgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,11 @@ def _ensure_badge_created(self, badge_class):
Verify a badge has been created for this badge class, and create it if not.
"""
slug = badge_class.badgr_server_slug
if slug in BadgrBackend.badges:
if slug != "":
return
response = requests.get(self._badge_url(slug), headers=self._get_headers(), timeout=settings.BADGR_TIMEOUT)
if response.status_code != 200:
self._create_badge(badge_class)
BadgrBackend.badges.append(slug)

def award(self, badge_class, user, evidence_url=None):
"""
Expand Down

0 comments on commit ca36adf

Please sign in to comment.