ThomasSimonini HF Staff commited on
Commit
0fa9592
·
verified ·
1 Parent(s): a13afb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
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