Update app.py
Browse files
app.py
CHANGED
|
@@ -150,6 +150,14 @@ def add_new_eval(
|
|
| 150 |
mail: str,
|
| 151 |
profile: gr.OAuthProfile,
|
| 152 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
# Was the profile created less than 2 month ago?
|
| 154 |
user_data = requests.get(f"https://huggingface.co/api/users/{profile.username}/overview")
|
| 155 |
creation_date = json.loads(user_data.content)["createdAt"]
|
|
|
|
| 150 |
mail: str,
|
| 151 |
profile: gr.OAuthProfile,
|
| 152 |
):
|
| 153 |
+
|
| 154 |
+
# --- NEW: Mandatory Field Check ---
|
| 155 |
+
if not organisation or organisation.strip() == "":
|
| 156 |
+
return format_warning("Please provide an Author/Team name before submitting.")
|
| 157 |
+
|
| 158 |
+
if not model or model.strip() == "":
|
| 159 |
+
return format_warning("Please provide a Submission name.")
|
| 160 |
+
# ----------------------------------
|
| 161 |
# Was the profile created less than 2 month ago?
|
| 162 |
user_data = requests.get(f"https://huggingface.co/api/users/{profile.username}/overview")
|
| 163 |
creation_date = json.loads(user_data.content)["createdAt"]
|