Skip to content

Commit

Permalink
add badgr settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Faraz Maqsood authored and Muhammad Faraz Maqsood committed Dec 21, 2023
1 parent c9890f3 commit d848107
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lms/djangoapps/badges/events/course_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,4 @@ def course_badge_check(user, course_key):
LOGGER.info("Completion badge already exists for this user on this course.")
# Badge already exists. Skip.
return
evidence = evidence_url(user.id, course_key)
badge_class.award(user, evidence_url=evidence)
badge_class.award(user)
8 changes: 4 additions & 4 deletions lms/djangoapps/certificates/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from lms.djangoapps.badges.events.course_meta import completion_check, course_group_check
from lms.djangoapps.certificates.data import CertificateStatuses
from lms.djangoapps.instructor_task.models import InstructorTask
from openedx.core.djangoapps.signals.signals import COURSE_CERT_AWARDED, COURSE_CERT_CHANGED, COURSE_CERT_REVOKED
from openedx.core.djangoapps.signals.signals import COURSE_CERT_AWARDED, COURSE_CERT_CHANGED, COURSE_CERT_REVOKED, COURSE_GRADE_NOW_PASSED
from openedx.core.djangoapps.xmodule_django.models import NoneToEmptyManager
from openedx.features.name_affirmation_api.utils import get_name_affirmation_service

Expand Down Expand Up @@ -1235,13 +1235,13 @@ class Meta:
app_label = "certificates"


@receiver(COURSE_CERT_AWARDED, sender=GeneratedCertificate)
@receiver(COURSE_GRADE_NOW_PASSED, dispatch_uid="new_passing_learner")
# pylint: disable=unused-argument
def create_course_badge(sender, user, course_key, status, **kwargs):
def create_course_badge(sender, user, course_id, **kwargs):
"""
Standard signal hook to create course badges when a certificate has been generated.
"""
course_badge_check(user, course_key)
course_badge_check(user, course_id)


@receiver(COURSE_CERT_AWARDED, sender=GeneratedCertificate)
Expand Down

0 comments on commit d848107

Please sign in to comment.