Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,10 +32,9 @@ USER_DATABASE_UPDATE_SCHEDULER = CommitScheduler(
|
|
32 |
repo_type="dataset",
|
33 |
folder_path=USER_DATABASE_DIR,
|
34 |
path_in_repo="data",
|
35 |
-
every=
|
36 |
)
|
37 |
def create_new_user(authenticator, users):
|
38 |
-
global USER_DATABASE_PATH
|
39 |
|
40 |
try:
|
41 |
if authenticator.register_user('Register user', preauthorization=False):
|
@@ -43,7 +42,6 @@ def create_new_user(authenticator, users):
|
|
43 |
except Exception as e:
|
44 |
st.error(e)
|
45 |
with USER_DATABASE_UPDATE_SCHEDULER.lock:
|
46 |
-
USER_DATABASE_PATH = USER_DATABASE_DIR / f"tbyb-users-{uuid4()}.yaml"
|
47 |
with USER_DATABASE_PATH.open('w') as file:
|
48 |
yaml.dump(users, file, default_flow_style=False)
|
49 |
|
@@ -81,10 +79,7 @@ def user_login_create():
|
|
81 |
global AUTHENTICATOR
|
82 |
global TBYB_LOGO
|
83 |
global USER_LOGGED_IN
|
84 |
-
global USER_DATABASE_PATH
|
85 |
users = None
|
86 |
-
if not os.path.exists(USER_DATABASE_PATH):
|
87 |
-
USER_DATABASE_PATH=base_user_database_path
|
88 |
with open(USER_DATABASE_PATH) as file:
|
89 |
users = yaml.load(file, Loader=SafeLoader)
|
90 |
AUTHENTICATOR = stauth.Authenticate(
|
|
|
32 |
repo_type="dataset",
|
33 |
folder_path=USER_DATABASE_DIR,
|
34 |
path_in_repo="data",
|
35 |
+
every=5,
|
36 |
)
|
37 |
def create_new_user(authenticator, users):
|
|
|
38 |
|
39 |
try:
|
40 |
if authenticator.register_user('Register user', preauthorization=False):
|
|
|
42 |
except Exception as e:
|
43 |
st.error(e)
|
44 |
with USER_DATABASE_UPDATE_SCHEDULER.lock:
|
|
|
45 |
with USER_DATABASE_PATH.open('w') as file:
|
46 |
yaml.dump(users, file, default_flow_style=False)
|
47 |
|
|
|
79 |
global AUTHENTICATOR
|
80 |
global TBYB_LOGO
|
81 |
global USER_LOGGED_IN
|
|
|
82 |
users = None
|
|
|
|
|
83 |
with open(USER_DATABASE_PATH) as file:
|
84 |
users = yaml.load(file, Loader=SafeLoader)
|
85 |
AUTHENTICATOR = stauth.Authenticate(
|