Skip to content

Commit

Permalink
feat: [ACI-729] add badge awarding on course passing (#85)
Browse files Browse the repository at this point in the history
* feat: [ACI-729] add badge awarding on course passing

* feat: [ACI-729] temporarily fake signal parameters

---------

Co-authored-by: Andrii <andrii.hantkovskyi@raccoongang.com>
  • Loading branch information
andrii-hantkovskyi and Andrii authored Mar 28, 2024
1 parent 279ed81 commit 7f4cd27
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions credentials/apps/credentials/handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from django.dispatch import receiver

from openedx_events.learning.signals import COURSE_GRADE_NOW_PASSED, CCX_COURSE_GRADE_NOW_PASSED

from apps.badges.signals.signals import BADGE_PROGRESS_COMPLETE

@receiver(COURSE_GRADE_NOW_PASSED)
def listen_passed_course(sender, *args, **kwargs):
BADGE_PROGRESS_COMPLETE.send(sender=sender, username=kwargs.get("user_course_data").user.username, badge_template_id=1) # temporarily faked badge_template_id

@receiver(CCX_COURSE_GRADE_NOW_PASSED)
def listen_passed_ccx_course(sender, *args, **kwargs):
BADGE_PROGRESS_COMPLETE.send(sender=sender, username='edx', badge_template_id=1) # temporarily faked badge_template_id and username

0 comments on commit 7f4cd27

Please sign in to comment.