From b2db119bd952499121081edabca94c49d5ffd79f Mon Sep 17 00:00:00 2001 From: Ali Salman Date: Fri, 5 Jan 2024 14:25:31 +0500 Subject: [PATCH 1/2] fix: badge creation --- lms/djangoapps/badges/backends/badgr.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lms/djangoapps/badges/backends/badgr.py b/lms/djangoapps/badges/backends/badgr.py index aac5ae05a761..76e0ecfe470b 100644 --- a/lms/djangoapps/badges/backends/badgr.py +++ b/lms/djangoapps/badges/backends/badgr.py @@ -312,12 +312,9 @@ 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: - 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): """ From 3aaa2c0df8651442767cdedbec7f22245abeb350 Mon Sep 17 00:00:00 2001 From: Ali Salman Date: Fri, 5 Jan 2024 14:25:51 +0500 Subject: [PATCH 2/2] fix: badge creation --- lms/djangoapps/badges/backends/badgr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lms/djangoapps/badges/backends/badgr.py b/lms/djangoapps/badges/backends/badgr.py index 76e0ecfe470b..d25bdfe822b1 100644 --- a/lms/djangoapps/badges/backends/badgr.py +++ b/lms/djangoapps/badges/backends/badgr.py @@ -312,6 +312,8 @@ 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 != "": + 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)