Files
edx-platform/lms/djangoapps/certificates/services.py
Isaac Lee 2ae07387b2 feat: receiver for invalidate certificate (#33319)
* feat: receiver for invalidate certificate

- consumes event of exam attempt rejected
- initial commit, need to make tests

* temp: moving consumer from signals to handlers.py

- Still need to make this work
- Need to make tests work too

* feat: refactored underlying code to api.py

- tests still need to be tweaked

* fix: commit history

* fix: improve api func name + add source param
2023-10-05 19:39:14 +00:00

17 lines
514 B
Python

"""
Certificate service
"""
from lms.djangoapps.certificates.api import invalidate_certificate
class CertificateService:
"""
User Certificate service
"""
def invalidate_certificate(self, user_id, course_key_or_id):
# The original code for this function was moved to this helper function to be call-able
# By both the legacy and current exams backends (edx-proctoring and edx-exams).
return invalidate_certificate(user_id, course_key_or_id, source='certificate_service')