Commit
·
1938471
1
Parent(s):
b37d53e
Small possible edge case with empty username
Browse files- validation.py +2 -0
validation.py
CHANGED
@@ -31,6 +31,8 @@ def validate_username(username: str) -> bool:
|
|
31 |
gr.Error: If username is invalid or profile doesn't exist
|
32 |
"""
|
33 |
username = username.strip()
|
|
|
|
|
34 |
|
35 |
# Check if the Hugging Face profile exists
|
36 |
profile_url = f"https://huggingface.co/{username}"
|
|
|
31 |
gr.Error: If username is invalid or profile doesn't exist
|
32 |
"""
|
33 |
username = username.strip()
|
34 |
+
if username == "":
|
35 |
+
raise gr.Error("❌ Please provide a username.")
|
36 |
|
37 |
# Check if the Hugging Face profile exists
|
38 |
profile_url = f"https://huggingface.co/{username}"
|