PATCH: removed commit_data method from database as it is no longer necessary

This commit is contained in:
white
2025-01-29 11:59:12 +00:00
parent e2070be9f9
commit f63dc4a368
5 changed files with 1 additions and 6 deletions

View File

@@ -93,7 +93,6 @@ def signup():
None None
) )
) )
db.commit_data()
# Create session for new user, to avoid them having unnecessary state info # Create session for new user, to avoid them having unnecessary state info
session.clear() session.clear()

View File

@@ -107,5 +107,4 @@ def save_chat(chatter_id, stream_id, message):
db.execute(""" db.execute("""
INSERT INTO chat (chatter_id, stream_id, message) INSERT INTO chat (chatter_id, stream_id, message)
VALUES (?, ?, ?);""", (chatter_id, stream_id, message)) VALUES (?, ?, ?);""", (chatter_id, stream_id, message))
db.commit_data()
db.close_connection() db.close_connection()

View File

@@ -180,7 +180,6 @@ def publish_stream():
1, 1,
datetime.now(), datetime.now(),
1)) 1))
db.commit_data()
return redirect(f"/{user_info['username']}") return redirect(f"/{user_info['username']}")
@@ -198,6 +197,5 @@ def end_stream():
# Set stream to not live # Set stream to not live
db.execute("""UPDATE streams SET isLive = 0 WHERE user_id = ? AND isLive = 1""", (user_info["user_id"],)) db.execute("""UPDATE streams SET isLive = 0 WHERE user_id = ? AND isLive = 1""", (user_info["user_id"],))
db.commit_data()
return "Stream ended", 200 return "Stream ended", 200

View File

@@ -17,7 +17,7 @@ CREATE TABLE stream_tags
DROP TABLE IF EXISTS chat; DROP TABLE IF EXISTS chat;
CREATE TABLE chat CREATE TABLE chat
( (
message_id INTEGER PRIMARY KEY AUTOINCREMENT , message_id INTEGER PRIMARY KEY AUTOINCREMENT,
stream_id INTEGER NOT NULL, stream_id INTEGER NOT NULL,
chatter_id VARCHAR(50) NOT NULL, chatter_id VARCHAR(50) NOT NULL,
message VARCHAR(256) NOT NULL, message VARCHAR(256) NOT NULL,

View File

@@ -130,7 +130,6 @@ def reset_password(new_password: str, email: str):
try: try:
db.execute("UPDATE users SET password = ? WHERE email = ?", (generate_password_hash(new_password), email)) db.execute("UPDATE users SET password = ? WHERE email = ?", (generate_password_hash(new_password), email))
db.commit_data()
return True return True
except Exception as e: except Exception as e:
print(f"Error: {e}") print(f"Error: {e}")