Spaces:
Runtime error
Runtime error
Commit
ยท
43c900f
1
Parent(s):
5d3be21
fix UI overlay reset after SDG reboot
Browse files
src/synthetic_dataset_generator/utils.py
CHANGED
|
@@ -22,10 +22,15 @@ def get_duplicate_button():
|
|
| 22 |
|
| 23 |
|
| 24 |
def list_orgs(oauth_token: Union[OAuthToken, None] = None):
|
|
|
|
|
|
|
| 25 |
try:
|
| 26 |
-
if oauth_token is None:
|
| 27 |
-
return []
|
| 28 |
data = whoami(oauth_token.token)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
if data["auth"]["type"] == "oauth":
|
| 30 |
organizations = [data["name"]] + [org["name"] for org in data["orgs"]]
|
| 31 |
elif data["auth"]["type"] == "access_token":
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
def list_orgs(oauth_token: Union[OAuthToken, None] = None):
|
| 25 |
+
if oauth_token is None:
|
| 26 |
+
return []
|
| 27 |
try:
|
|
|
|
|
|
|
| 28 |
data = whoami(oauth_token.token)
|
| 29 |
+
except Exception:
|
| 30 |
+
swap_visibility(None)
|
| 31 |
+
return []
|
| 32 |
+
|
| 33 |
+
try:
|
| 34 |
if data["auth"]["type"] == "oauth":
|
| 35 |
organizations = [data["name"]] + [org["name"] for org in data["orgs"]]
|
| 36 |
elif data["auth"]["type"] == "access_token":
|