Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
d4e6ad5f
Commit
d4e6ad5f
authored
Sep 21, 2020
by
Laury Bueno
Browse files
[Certificate] Minor improvements on the certificate generation script
parent
c930185c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
courses/certification/management/commands/generate_coursecertifications.py
...tion/management/commands/generate_coursecertifications.py
+4
-1
No files found.
courses/certification/management/commands/generate_coursecertifications.py
View file @
d4e6ad5f
...
...
@@ -47,8 +47,8 @@ class Command(BaseCommand):
created_cc
+=
1
# If '--certificate' was passed, transform any earned receipt in a certificate
certificates_earned
=
0
if
options
[
'certificate'
]:
certificates_earned
=
0
for
cc
in
CourseCertification
.
objects
.
all
():
if
cc
.
course_student
.
can_emmit_receipt
()
and
cc
.
type
==
CourseCertification
.
TYPES
[
0
][
0
]:
cc
.
type
=
CourseCertification
.
TYPES
[
1
][
0
]
...
...
@@ -56,6 +56,9 @@ class Command(BaseCommand):
cc
.
save
()
certificates_earned
+=
1
if
options
[
'dry_run'
]:
print
(
'This is a dry run, so the below changes will not be commited'
)
print
(
f
'CourseCertification objects created:
{
created_cc
}
'
)
if
options
[
'certificate'
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment