From c910166ac8de46b92d3580c59defb1e8da6f3961 Mon Sep 17 00:00:00 2001 From: Ali Salman Date: Fri, 26 Apr 2024 13:38:51 +0500 Subject: [PATCH] fix: program badge --- lms/djangoapps/badges/backends/badgr.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/badges/backends/badgr.py b/lms/djangoapps/badges/backends/badgr.py index 5d3beafc97c2..d96128beef21 100644 --- a/lms/djangoapps/badges/backends/badgr.py +++ b/lms/djangoapps/badges/backends/badgr.py @@ -189,13 +189,11 @@ def _create_assertion(self, badge_class, user, evidence_url): "identity": user.email, "type": "email" }, - "evidence": [ - { - "url": evidence_url - } - ], "notify": settings.BADGR_ENABLE_NOTIFICATIONS, } + if evidence_url: + data["evidence"] = [{"url": evidence_url}] + response = requests.post( self._assertion_url(badge_class.badgr_server_slug), headers=self._get_headers(),