PATCH: removed commit_data method from database as it is no longer necessary
This commit is contained in:
@@ -93,7 +93,6 @@ def signup():
|
||||
None
|
||||
)
|
||||
)
|
||||
db.commit_data()
|
||||
|
||||
# Create session for new user, to avoid them having unnecessary state info
|
||||
session.clear()
|
||||
|
||||
@@ -107,5 +107,4 @@ def save_chat(chatter_id, stream_id, message):
|
||||
db.execute("""
|
||||
INSERT INTO chat (chatter_id, stream_id, message)
|
||||
VALUES (?, ?, ?);""", (chatter_id, stream_id, message))
|
||||
db.commit_data()
|
||||
db.close_connection()
|
||||
|
||||
@@ -180,7 +180,6 @@ def publish_stream():
|
||||
1,
|
||||
datetime.now(),
|
||||
1))
|
||||
db.commit_data()
|
||||
|
||||
return redirect(f"/{user_info['username']}")
|
||||
|
||||
@@ -198,6 +197,5 @@ def end_stream():
|
||||
|
||||
# Set stream to not live
|
||||
db.execute("""UPDATE streams SET isLive = 0 WHERE user_id = ? AND isLive = 1""", (user_info["user_id"],))
|
||||
db.commit_data()
|
||||
|
||||
return "Stream ended", 200
|
||||
|
||||
@@ -17,7 +17,7 @@ CREATE TABLE stream_tags
|
||||
DROP TABLE IF EXISTS chat;
|
||||
CREATE TABLE chat
|
||||
(
|
||||
message_id INTEGER PRIMARY KEY AUTOINCREMENT ,
|
||||
message_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
stream_id INTEGER NOT NULL,
|
||||
chatter_id VARCHAR(50) NOT NULL,
|
||||
message VARCHAR(256) NOT NULL,
|
||||
|
||||
@@ -130,7 +130,6 @@ def reset_password(new_password: str, email: str):
|
||||
|
||||
try:
|
||||
db.execute("UPDATE users SET password = ? WHERE email = ?", (generate_password_hash(new_password), email))
|
||||
db.commit_data()
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
Reference in New Issue
Block a user