File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -909,6 +909,42 @@ def db_test():
909909 "database_path" : db_path
910910 })
911911
912+ @app .route ('/check-users' )
913+ def check_users ():
914+ """Check if users exist in database - for debugging"""
915+ try :
916+ import sqlite3
917+ conn = sqlite3 .connect (db_path )
918+
919+ # Check if user table exists
920+ cursor = conn .execute ("SELECT name FROM sqlite_master WHERE type='table' AND name='user'" )
921+ if not cursor .fetchone ():
922+ return jsonify ({"status" : "error" , "message" : "User table does not exist" })
923+
924+ # Get all users
925+ cursor = conn .execute ("SELECT id, username, email, created_at FROM user" )
926+ users = cursor .fetchall ()
927+
928+ conn .close ()
929+
930+ user_list = []
931+ for user in users :
932+ user_list .append ({
933+ "id" : user [0 ],
934+ "username" : user [1 ],
935+ "email" : user [2 ],
936+ "created_at" : user [3 ]
937+ })
938+
939+ return jsonify ({
940+ "status" : "success" ,
941+ "user_count" : len (user_list ),
942+ "users" : user_list
943+ })
944+
945+ except Exception as e :
946+ return jsonify ({"status" : "error" , "message" : str (e )})
947+
912948@app .errorhandler (404 )
913949def not_found_error (error ):
914950 return render_template ('404.html' ), 404
Original file line number Diff line number Diff line change 1+ # Netscape HTTP Cookie File
2+ # https://curl.se/docs/http-cookies.html
3+ # This file was generated by libcurl! Edit at your own risk.
4+
You can’t perform that action at this time.
0 commit comments