Skip to content

Commit

Permalink
fix: remove unused certificate id
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-canon committed Aug 31, 2023
1 parent a278f69 commit c8422aa
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions eox_nelp/signals/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
"""
from django.conf import settings
from django.contrib.auth import get_user_model
from eox_core.edxapp_wrapper.certificates import get_generated_certificate
from eox_core.edxapp_wrapper.grades import get_course_grade_factory
from opaque_keys.edx.keys import CourseKey

from eox_nelp.utils import is_valid_national_id

CourseGradeFactory = get_course_grade_factory()
GeneratedCertificate = get_generated_certificate()
User = get_user_model()


Expand All @@ -34,17 +32,12 @@ def _generate_external_certificate_data(time, certificate_data):
Dict: certificate data
"""
user = User.objects.get(id=certificate_data.user.id)
certificate = GeneratedCertificate.objects.get(
user=user,
course_id=certificate_data.course.course_key,
)
group_codes = getattr(settings, "EXTERNAL_CERTIFICATES_GROUP_CODES", {})
course_id = str(certificate_data.course.course_key)
extra_info = getattr(user, "extrainfo", None)
national_id = user.username[:10] # saml association extra filter

return {
"id": certificate.id,
"reference_id": generate_reference_id(national_id, course_id),
"created_at": str(time.date()),
"expiration_date": None,
Expand Down

0 comments on commit c8422aa

Please sign in to comment.