Skip to content

Commit f4b7b2c

Browse files
authored
Merge pull request #19 from Xpirix/fix_preview_certificate
Fix preview certificate
2 parents b7cf280 + 92eb547 commit f4b7b2c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

django_project/certification/views/certificate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ def generate_pdf(
249249
pathname, project, course, attendee, certificate, current_site,
250250
wording='Has attended and completed the course:'):
251251
"""Create the PDF object, using the response object as its file."""
252-
if not certificate.is_paid:
252+
253+
# Check if certificate is paid or not
254+
# Allow dummy certificate (preview) to be generated
255+
if not isinstance(certificate, DummyCertificate) and not certificate.is_paid:
253256
return
254257
# Register new font
255258
try:

0 commit comments

Comments
 (0)