Update app.py
Browse files
app.py
CHANGED
|
@@ -60,6 +60,8 @@ def grant_access_multiple_repos(token, repo_list, username):
|
|
| 60 |
|
| 61 |
Users are dereferenced by organisation.
|
| 62 |
"""
|
|
|
|
|
|
|
| 63 |
if not isinstance(repo_list, list):
|
| 64 |
repo_list = [repo_list]
|
| 65 |
lusers = get_organisation(username)
|
|
@@ -121,9 +123,9 @@ with gr.Blocks(title="HF Repo Access Manager") as demo:
|
|
| 121 |
# Refresh external data.
|
| 122 |
def refresh_all_data(username, token, force = False, indwild = False):
|
| 123 |
try:
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
# Refresh repos
|
| 128 |
lrepos = get_gated_repos(username, token)
|
| 129 |
# Add wildcard at the top.
|
|
|
|
| 60 |
|
| 61 |
Users are dereferenced by organisation.
|
| 62 |
"""
|
| 63 |
+
if not token:
|
| 64 |
+
return "ERROR: Cannot grant access without a token."
|
| 65 |
if not isinstance(repo_list, list):
|
| 66 |
repo_list = [repo_list]
|
| 67 |
lusers = get_organisation(username)
|
|
|
|
| 123 |
# Refresh external data.
|
| 124 |
def refresh_all_data(username, token, force = False, indwild = False):
|
| 125 |
try:
|
| 126 |
+
# Doesn't matter, listing works without tokens.
|
| 127 |
+
# if not token:
|
| 128 |
+
# raise ValueError("Please login first!")
|
| 129 |
# Refresh repos
|
| 130 |
lrepos = get_gated_repos(username, token)
|
| 131 |
# Add wildcard at the top.
|