Update app.py
Browse files
app.py
CHANGED
|
@@ -71,7 +71,6 @@ def handle_certificate(name, profile: gr.OAuthProfile):
|
|
| 71 |
return "You must be logged in with your Hugging Face account.", None
|
| 72 |
|
| 73 |
username = profile.username
|
| 74 |
-
print("USERNAME", username)
|
| 75 |
user_score = check_user_score(username)
|
| 76 |
|
| 77 |
if not user_score:
|
|
@@ -82,10 +81,8 @@ def handle_certificate(name, profile: gr.OAuthProfile):
|
|
| 82 |
if score < THRESHOLD_SCORE:
|
| 83 |
return f"Your score is {score}. You need at least {THRESHOLD_SCORE} to pass.", None, None
|
| 84 |
|
| 85 |
-
if not has_certificate_entry(username):
|
| 86 |
-
add_certificate_entry(username, name)
|
| 87 |
-
|
| 88 |
certificate_image, certificate_pdf = generate_certificate(name, score)
|
|
|
|
| 89 |
return "Congratulations! Here's your certificate:", certificate_image, certificate_pdf
|
| 90 |
|
| 91 |
# Gradio interface
|
|
|
|
| 71 |
return "You must be logged in with your Hugging Face account.", None
|
| 72 |
|
| 73 |
username = profile.username
|
|
|
|
| 74 |
user_score = check_user_score(username)
|
| 75 |
|
| 76 |
if not user_score:
|
|
|
|
| 81 |
if score < THRESHOLD_SCORE:
|
| 82 |
return f"Your score is {score}. You need at least {THRESHOLD_SCORE} to pass.", None, None
|
| 83 |
|
|
|
|
|
|
|
|
|
|
| 84 |
certificate_image, certificate_pdf = generate_certificate(name, score)
|
| 85 |
+
add_certificate_entry(username, name)
|
| 86 |
return "Congratulations! Here's your certificate:", certificate_image, certificate_pdf
|
| 87 |
|
| 88 |
# Gradio interface
|