IsaacKerson commited on
Commit
ad65049
1 Parent(s): 781d8ed

added db with user table

Browse files
Files changed (4) hide show
  1. authenticator.py +14 -0
  2. old/quiz_maker.db +0 -0
  3. pages/join.py +1 -1
  4. pages/quiz_maker.db +0 -0
authenticator.py CHANGED
@@ -98,6 +98,20 @@ class Authenticate:
98
  return True
99
  except Exception as ex:
100
  return False
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
  def token_encode(self):
103
  """
98
  return True
99
  except Exception as ex:
100
  return False
101
+
102
+ def get_cursor(self):
103
+ return self.get_connection().cursor()
104
+
105
+ def check_username(self):
106
+ usernames = []
107
+ query = ("SELECT username FROM ?")
108
+ c = self.get_cursor()
109
+ for item[0] in c.execute(query, (self.dbtable))
110
+ usernames.append(item)
111
+ if self.name in usernames:
112
+ return True
113
+ else:
114
+ return False
115
 
116
  def token_encode(self):
117
  """
old/quiz_maker.db ADDED
Binary file (53.2 kB). View file
pages/join.py CHANGED
@@ -55,7 +55,7 @@ def app():
55
  else:
56
  uct_iso = datetime.datetime.utcnow().isoformat()
57
  hashed_password = Hasher(password1).generate()
58
- st.write(first_name, last_name, user_name, email, hashed_password)
59
  query = "INSERT INTO users(uct_iso, firstname, lastname, username, email, hashed_password) VALUES(?, ?, ?, ?, ?, ?)"
60
  c.execute(query, (uct_iso, first_name, last_name, user_name, email, hashed_password))
61
  conn.commit()
55
  else:
56
  uct_iso = datetime.datetime.utcnow().isoformat()
57
  hashed_password = Hasher(password1).generate()
58
+ st.write(firstname, lastname, username, email, hashedpassword)
59
  query = "INSERT INTO users(uct_iso, firstname, lastname, username, email, hashed_password) VALUES(?, ?, ?, ?, ?, ?)"
60
  c.execute(query, (uct_iso, first_name, last_name, user_name, email, hashed_password))
61
  conn.commit()
pages/quiz_maker.db CHANGED
Binary files a/pages/quiz_maker.db and b/pages/quiz_maker.db differ