Ridealist commited on
Commit
8d88728
1 Parent(s): d2e9d7c

feat: Apply user validation logic in User ID input form by scanning DB

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -15,7 +15,7 @@ from time import strftime
15
  from audiorecorder import audiorecorder
16
 
17
  # modules
18
- from modules.db_modules import get_db, put_item, get_item, get_lastest_item
19
  from modules.gpt_modules import gpt_call, gpt_call_context
20
  from modules.whisper_modules import whisper_transcribe
21
 
@@ -136,8 +136,10 @@ def page_n_1_controller():
136
  #########################################################
137
  # Page 1
138
  #########################################################
139
- def validate_user_id(input):
140
- if input.strip():
 
 
141
  return True
142
  else:
143
  return False
 
15
  from audiorecorder import audiorecorder
16
 
17
  # modules
18
+ from modules.db_modules import get_db, put_item, get_all_items, get_lastest_item
19
  from modules.gpt_modules import gpt_call, gpt_call_context
20
  from modules.whisper_modules import whisper_transcribe
21
 
 
136
  #########################################################
137
  # Page 1
138
  #########################################################
139
+ def validate_user_id(id_input):
140
+ table = dynamodb.Table('DEBO_user')
141
+ users_set = get_all_items(table, 'user_id')
142
+ if id_input in users_set:
143
  return True
144
  else:
145
  return False