god i am done with this program

This commit is contained in:
klein panic
2024-10-02 02:14:57 -04:00
parent dd4b46ecdc
commit cc6f0400b7
19 changed files with 808 additions and 176 deletions

View File

@@ -99,8 +99,14 @@ def reset_login_attempts(username):
def increment_login_attempts(username):
with closing(sqlite3.connect(DATABASE)) as conn, conn, closing(conn.cursor()) as c:
c.execute('UPDATE users SET login_attempts = login_attempts + 1 WHERE username = ?', (username,))
conn.commit()
if username:
c.execute('UPDATE users SET login_attempts = login_attempts + 1 WHERE username = ?', (username,))
c.execute('SELECT login_attempts FROM users WHERE username = ?', (username,))
login_attempts = c.fetchone()[0]
conn.commit()
return login_attempts
else:
return None
def add_upload(uploader, file_type, content):
with closing(sqlite3.connect(DATABASE)) as conn, conn, closing(conn.cursor()) as c: