Skip to content

Commit

Permalink
Update epoch_post_persistence.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Aymanhki authored Apr 9, 2024
1 parent 66de6a6 commit beda559
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions epoch_backend/persistence/epoch/epoch_post_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def add_post(self, new_post: post):
mentioned_notification = cursor.fetchone()

if not mentioned_notification and mentioned_user[0] != new_post.user_id:
cursor.execute("INSERT INTO notifications (user_id, type, target_id, target_username, target_name) VALUES (%s, %s, %s, %s, %s)", (mentioned_user[0], "mention", post_id, user_info[0], user_info[1]))
cursor.execute("INSERT INTO notifications (user_id, type, target_id, created_at, target_username, target_name) VALUES (%s, %s, %s, %s, %s, %s)", (mentioned_user[0], "mention", post_id, new_post.release, user_info[0], user_info[1]))
connection.commit()


Expand Down Expand Up @@ -205,7 +205,7 @@ def update_post(self, post_id: int, new_post: post):
mentioned_notification = cursor.fetchone()

if not mentioned_notification and mentioned_user[0] != new_post.user_id:
cursor.execute("INSERT INTO notifications (user_id, type, target_id, target_username, target_name) VALUES (%s, %s, %s, %s, %s)", (mentioned_user[0], "mention", post_id, user_info[0], user_info[1]))
cursor.execute("INSERT INTO notifications (user_id, type, target_id, created_at, target_username, target_name) VALUES (%s, %s, %s, %s, %s, %s)", (mentioned_user[0], "mention", post_id, new_post.release, user_info[0], user_info[1]))
connection.commit()

if old_post_caption:
Expand Down

0 comments on commit beda559

Please sign in to comment.