JVice commited on
Commit
1bf06f8
1 Parent(s): 2d548d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -35,12 +35,15 @@ USER_DATABASE_UPDATE_SCHEDULER = CommitScheduler(
35
  every=2,
36
  )
37
  def create_new_user(authenticator, users):
 
 
38
  try:
39
  if authenticator.register_user('Register user', preauthorization=False):
40
  st.success('User registered successfully')
41
  except Exception as e:
42
  st.error(e)
43
  with USER_DATABASE_UPDATE_SCHEDULER.lock:
 
44
  with USER_DATABASE_PATH.open('w') as file:
45
  yaml.dump(users, file, default_flow_style=False)
46
 
 
35
  every=2,
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):
42
  st.success('User registered successfully')
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