-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust persist_notification_update params
- Loading branch information
Showing
2 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,7 @@ def get_pending_notifications(self, page: int, page_size: int) -> list[Notificat | |
|
||
def persist_notification( | ||
self, | ||
user_id: uuid.UUID, | ||
user_id: uuid.UUID | str | int, | ||
notification_type: str, | ||
title: str, | ||
body_template: str, | ||
|
@@ -146,11 +146,11 @@ def persist_notification( | |
return notification | ||
|
||
def persist_notification_update( | ||
self, notification_id: int | str | uuid.UUID, **kwargs: UpdateNotificationKwargs | ||
self, notification_id: int | str | uuid.UUID, updated_data: UpdateNotificationKwargs | ||
) -> Notification: | ||
notification = self.get_notification(notification_id) | ||
|
||
for key, value in kwargs.items(): | ||
for key, value in updated_data.items(): | ||
setattr(notification, key, value) | ||
|
||
return notification | ||
|
@@ -209,7 +209,7 @@ def __paginate_notifications(self, notifications: list[Notification], page: int, | |
|
||
def get_user_email_from_notification(self, notification_id: int | str | uuid.UUID) -> str: | ||
notification = self.get_notification(notification_id) | ||
return notification.context_kwargs.get("email", "[email protected]") | ||
return str(notification.context_kwargs.get("email", "[email protected]")) | ||
|
||
def store_context_used(self, notification_id: int | str | uuid.UUID, context: dict) -> None: | ||
notification = self.get_notification(notification_id) | ||
|