Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def handle_certificate(name, profile: gr.OAuthProfile):
|
|
62 |
user_score = check_user_score(username)
|
63 |
|
64 |
if not user_score:
|
65 |
-
return "You need to complete Unit 4 first.", None
|
66 |
|
67 |
score = user_score["score"]
|
68 |
|
@@ -70,7 +70,7 @@ def handle_certificate(name, profile: gr.OAuthProfile):
|
|
70 |
return f"Your score is {score}. You need at least {THRESHOLD_SCORE} to pass.", None, None
|
71 |
|
72 |
if not has_certificate_entry(username):
|
73 |
-
|
74 |
|
75 |
certificate_image, certificate_pdf = generate_certificate(name, score)
|
76 |
return "Congratulations! Here's your certificate:", certificate_image, certificate_pdf
|
|
|
62 |
user_score = check_user_score(username)
|
63 |
|
64 |
if not user_score:
|
65 |
+
return "You need to complete Unit 4 first.", None, None
|
66 |
|
67 |
score = user_score["score"]
|
68 |
|
|
|
70 |
return f"Your score is {score}. You need at least {THRESHOLD_SCORE} to pass.", None, None
|
71 |
|
72 |
if not has_certificate_entry(username):
|
73 |
+
add_certificate_entry(username, name)
|
74 |
|
75 |
certificate_image, certificate_pdf = generate_certificate(name, score)
|
76 |
return "Congratulations! Here's your certificate:", certificate_image, certificate_pdf
|