YchKhan commited on
Commit
ef44764
1 Parent(s): 7fa6d71

Update users_management.py

Browse files
Files changed (1) hide show
  1. users_management.py +2 -5
users_management.py CHANGED
@@ -75,14 +75,11 @@ def update_json(user, prompt, keywords):
75
  add_user_pref(username, prompt, users,input_type='prompts')
76
  add_user_pref(username, keywords, users,input_type='keywords')
77
  save_user_data_to_json(username)
78
-
79
- with open('users.json', 'r') as file:
80
- saved_data = json.load(file)
81
 
82
 
83
  def auth_user(username, password):
84
- print('INSIDE')
85
- print(f"HASHED = {sha256(password.encode()).hexdigest() == users[username]['hashed_password']}\nusername={username}\nusers = {users}")
86
  if username in users and sha256(password.encode()).hexdigest() == users[username]['hashed_password']:
87
  user = users.get(username)
88
  else:
 
75
  add_user_pref(username, prompt, users,input_type='prompts')
76
  add_user_pref(username, keywords, users,input_type='keywords')
77
  save_user_data_to_json(username)
78
+
79
+ return gr.update(choices=user['history']['prompts']), gr.update(choices=user['history']['keywords'])
 
80
 
81
 
82
  def auth_user(username, password):
 
 
83
  if username in users and sha256(password.encode()).hexdigest() == users[username]['hashed_password']:
84
  user = users.get(username)
85
  else: