JVice commited on
Commit
311cf8b
1 Parent(s): 0157f23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -22,17 +22,17 @@ USER_LOGGED_IN = False
22
  base_user_database_path = './data/user_database.yaml'
23
 
24
 
25
- USER_DATABASE_DIR = Path("data")
26
  USER_DATABASE_DIR.mkdir(parents=True, exist_ok=True)
27
 
28
- USER_DATABASE_PATH = USER_DATABASE_DIR / f"user_database.yaml"
29
 
30
  USER_DATABASE_UPDATE_SCHEDULER = CommitScheduler(
31
  repo_id="try-before-you-bias-data",
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
 
@@ -80,7 +80,7 @@ def user_login_create():
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(
86
  users['credentials'],
 
22
  base_user_database_path = './data/user_database.yaml'
23
 
24
 
25
+ USER_DATABASE_DIR = Path("user_database")
26
  USER_DATABASE_DIR.mkdir(parents=True, exist_ok=True)
27
 
28
+ USER_DATABASE_PATH = USER_DATABASE_DIR / f"user_database-{uuid4}.yaml"
29
 
30
  USER_DATABASE_UPDATE_SCHEDULER = CommitScheduler(
31
  repo_id="try-before-you-bias-data",
32
  repo_type="dataset",
33
  folder_path=USER_DATABASE_DIR,
34
  path_in_repo="data",
35
+ every=10,
36
  )
37
  def create_new_user(authenticator, users):
38
 
 
80
  global TBYB_LOGO
81
  global USER_LOGGED_IN
82
  users = None
83
+ with open(base_user_database_path) as file:
84
  users = yaml.load(file, Loader=SafeLoader)
85
  AUTHENTICATOR = stauth.Authenticate(
86
  users['credentials'],