Spaces:
Sleeping
Sleeping
username
Browse files
blossomtune_gradio/ui/auth.py
CHANGED
|
@@ -14,5 +14,5 @@ def is_space_owner(profile: gr.OAuthProfile | None, oauth_token: gr.OAuthToken |
|
|
| 14 |
else:
|
| 15 |
org_names = []
|
| 16 |
return profile is not None and (
|
| 17 |
-
profile.
|
| 18 |
)
|
|
|
|
| 14 |
else:
|
| 15 |
org_names = []
|
| 16 |
return profile is not None and (
|
| 17 |
+
profile.username == cfg.SPACE_OWNER or cfg.SPACE_OWNER in org_names
|
| 18 |
)
|
blossomtune_gradio/ui/callbacks.py
CHANGED
|
@@ -31,11 +31,11 @@ def get_full_status_update(
|
|
| 31 |
if is_on_space:
|
| 32 |
if profile:
|
| 33 |
auth_status = (
|
| 34 |
-
f"✅ Logged in as **{profile.
|
| 35 |
if owner
|
| 36 |
-
else f"Logged in as: {profile.
|
| 37 |
)
|
| 38 |
-
hf_handle_val = profile.
|
| 39 |
else:
|
| 40 |
auth_status = "⚠️ You are not logged in. Please log in with Hugging Face."
|
| 41 |
else:
|
|
@@ -173,7 +173,7 @@ def on_check_participant_status(
|
|
| 173 |
)
|
| 174 |
}
|
| 175 |
|
| 176 |
-
user_hf_handle = profile.
|
| 177 |
if not user_hf_handle or not user_hf_handle.strip():
|
| 178 |
return {
|
| 179 |
components.request_status_md: gr.update(
|
|
|
|
| 31 |
if is_on_space:
|
| 32 |
if profile:
|
| 33 |
auth_status = (
|
| 34 |
+
f"✅ Logged in as **{profile.username}**. You are the space owner."
|
| 35 |
if owner
|
| 36 |
+
else f"Logged in as: {profile.username}."
|
| 37 |
)
|
| 38 |
+
hf_handle_val = profile.username
|
| 39 |
else:
|
| 40 |
auth_status = "⚠️ You are not logged in. Please log in with Hugging Face."
|
| 41 |
else:
|
|
|
|
| 173 |
)
|
| 174 |
}
|
| 175 |
|
| 176 |
+
user_hf_handle = profile.username if is_on_space else hf_handle
|
| 177 |
if not user_hf_handle or not user_hf_handle.strip():
|
| 178 |
return {
|
| 179 |
components.request_status_md: gr.update(
|