Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add username and date export certificates #39

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def handle(self, *args, **options):
)

course_key = CourseKey.from_string(course_id)
lms_base = SiteConfiguration.get_value_for_org(
course_key.org, "LMS_BASE", settings.LMS_BASE
lms_root_url = SiteConfiguration.get_value_for_org(
course_key.org, "LMS_ROOT_URL", settings.LMS_ROOT_URL
)

# prepare output
Expand All @@ -77,7 +77,9 @@ def handle(self, *args, **options):
[
"course_id",
"student email",
"student username",
"student name",
"certificate created date",
"certificate verify_uuid",
"certificate_web_link_url",
"certificate_download_pdf_link",
Expand All @@ -87,7 +89,7 @@ def handle(self, *args, **options):
# iterate each certificate and append each certificate as a row
for certificate in course_generated_certificates:
certificate_web_link_url = (
"https://" + lms_base + "/certificates/" + certificate.verify_uuid
f"{lms_root_url}/certificates/{certificate.verify_uuid}"
)
certificate_download_pdf_link = (
certificate_download_pdf_url + certificate.verify_uuid
Expand All @@ -97,7 +99,9 @@ def handle(self, *args, **options):
[
course_id,
certificate.user.email,
certificate.user.username,
certificate.name,
certificate.created_date,
certificate.verify_uuid,
certificate_web_link_url,
certificate_download_pdf_link,
Expand All @@ -112,7 +116,7 @@ def handle(self, *args, **options):
)

lms_instructor_data_download_url = (
f"https://{lms_base}/courses/{course_id}/instructor#view-data_download"
f"{lms_root_url}/courses/{course_id}/instructor#view-data_download"
)
self.log_msg(
f"You can confirm the existence of the file on: {lms_instructor_data_download_url}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ def handle(self, *args, **options):
)
delete_recursive(course_certificate_folder)

lms_base = SiteConfiguration.get_value_for_org(
course_key.org, "LMS_BASE", settings.LMS_BASE
lms_root_url = SiteConfiguration.get_value_for_org(
course_key.org, "LMS_ROOT_URL", settings.LMS_ROOT_URL
)
lms_instructor_data_download_url = (
f"https://{lms_base}/courses/{course_id}/instructor#view-data_download"
f"{lms_root_url}/courses/{course_id}/instructor#view-data_download"
)
self.log_msg(
f"You can confirm the existence of the file on: {lms_instructor_data_download_url}"
Expand Down
Loading