Spaces:
Sleeping
Sleeping
Upload server.py
Browse files
server.py
CHANGED
|
@@ -33,11 +33,16 @@ def init_db():
|
|
| 33 |
is_active boolean, face_data text, last_login datetime,
|
| 34 |
password text
|
| 35 |
)''')
|
| 36 |
-
# Use try-except to add password column if it doesn't exist
|
| 37 |
try:
|
| 38 |
c.execute("ALTER TABLE users ADD COLUMN password text")
|
| 39 |
except:
|
| 40 |
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
c.execute('''CREATE TABLE IF NOT EXISTS sessions (
|
| 42 |
id text PRIMARY KEY, teacher_id text, subject text,
|
| 43 |
qr_code text, qr_expires_at datetime, geofence_lat real,
|
|
|
|
| 33 |
is_active boolean, face_data text, last_login datetime,
|
| 34 |
password text
|
| 35 |
)''')
|
| 36 |
+
# Use try-except to add password column if it doesn't exist
|
| 37 |
try:
|
| 38 |
c.execute("ALTER TABLE users ADD COLUMN password text")
|
| 39 |
except:
|
| 40 |
pass
|
| 41 |
+
|
| 42 |
+
# AUTO-INIT: Set the temporary password for the student so upload is not required
|
| 43 |
+
c.execute("UPDATE users SET password = 'CBIT2024' WHERE email = 'ugs23020_csm.gowthami@cbit.org.in'")
|
| 44 |
+
|
| 45 |
+
conn.commit()
|
| 46 |
c.execute('''CREATE TABLE IF NOT EXISTS sessions (
|
| 47 |
id text PRIMARY KEY, teacher_id text, subject text,
|
| 48 |
qr_code text, qr_expires_at datetime, geofence_lat real,
|