Skip to content

Commit

Permalink
Merge pull request #4974 from bcgov/test-marshal-DV-4707-1
Browse files Browse the repository at this point in the history
query updated
  • Loading branch information
divyav-aot authored Jan 5, 2024
2 parents af1d67d + f7ed9e8 commit 6d72783
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def getnotificationsbyuserandtype(cls, userid, typeid):

@classmethod
def dismissbynotificationid(cls, notificationids, userid='system'):
db.session.query(FOIRawRequestNotificationUser).filter(FOIRawRequestNotificationUser.notificationid.in_(notificationids)).update({FOIRawRequestNotificationUser.isdeleted: True, FOIRawRequestNotificationUser.updatedby: userid,
db.session.query(FOIRawRequestNotificationUser).filter(FOIRawRequestNotificationUser.notificationid.in_(notificationids), FOIRawRequestNotificationUser.isdeleted == False).update({FOIRawRequestNotificationUser.isdeleted: True, FOIRawRequestNotificationUser.updatedby: userid,
FOIRawRequestNotificationUser.updated_at: datetime2.now()}, synchronize_session=False)
db.session.commit()
return DefaultMethodResult(True,'Notifications deleted for id',notificationids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def savenotification(cls,foinotification)->DefaultMethodResult:
@classmethod
def dismissnotification(cls, notificationids, userid='system'):
try:
db.session.query(FOIRawRequestNotification).filter(FOIRawRequestNotification.notificationid.in_(notificationids)).update({FOIRawRequestNotification.isdeleted: True, FOIRawRequestNotification.updatedby: userid,
db.session.query(FOIRawRequestNotification).filter(FOIRawRequestNotification.notificationid.in_(notificationids), FOIRawRequestNotification.isdeleted == False).update({FOIRawRequestNotification.isdeleted: True, FOIRawRequestNotification.updatedby: userid,
FOIRawRequestNotification.updated_at: datetime2.now()}, synchronize_session=False)
db.session.commit()
return DefaultMethodResult(True,'Notifications deleted ', notificationids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def dismissnotificationbyuserandtype(cls, userid, notificationusertypelabel):

@classmethod
def dismissbynotificationid(cls, notificationids, userid='system'):
db.session.query(FOIRequestNotificationUser).filter(FOIRequestNotificationUser.notificationid.in_(notificationids)).update({FOIRequestNotificationUser.isdeleted: True, FOIRequestNotificationUser.updatedby: userid,
db.session.query(FOIRequestNotificationUser).filter(FOIRequestNotificationUser.notificationid.in_(notificationids), FOIRequestNotificationUser.isdeleted == False).update({FOIRequestNotificationUser.isdeleted: True, FOIRequestNotificationUser.updatedby: userid,
FOIRequestNotificationUser.updated_at: datetime2.now()}, synchronize_session=False)
db.session.commit()
return DefaultMethodResult(True,'Notifications deleted for id',notificationids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def getextensionnotifications(cls, extensionid):
@classmethod
def dismissnotification(cls, notificationids, userid='system'):
try:
db.session.query(FOIRequestNotification).filter(FOIRequestNotification.notificationid.in_(notificationids)).update({FOIRequestNotification.isdeleted: True, FOIRequestNotification.updatedby: userid,
db.session.query(FOIRequestNotification).filter(FOIRequestNotification.notificationid.in_(notificationids), FOIRequestNotification.isdeleted == False).update({FOIRequestNotification.isdeleted: True, FOIRequestNotification.updatedby: userid,
FOIRequestNotification.updated_at: datetime2.now()}, synchronize_session=False)
db.session.commit()
return DefaultMethodResult(True,'Notifications deleted ', notificationids)
Expand Down

0 comments on commit 6d72783

Please sign in to comment.