creating only one notification per notification_type, even if multiple users request the same notification_type.
This commit is contained in:
parent
bc6d391094
commit
9709b06196
@ -313,9 +313,13 @@ class Notifier():
|
||||
|
||||
@staticmethod
|
||||
def create_notifications_for_user_list(shipcall, users:list[model.User]):
|
||||
notification_type_list = []
|
||||
for user in users:
|
||||
notification_type_list = Notifier.build_notification_type_list(user)
|
||||
user_notification_type_list = Notifier.build_notification_type_list(user)
|
||||
notification_type_list.extend(user_notification_type_list)
|
||||
|
||||
# get the unique notification types
|
||||
notification_type_list = list(set(notification_type_list))
|
||||
for notification_type in notification_type_list:
|
||||
schemaModel = dict(shipcall_id = shipcall.id, level = int(shipcall.evaluation), type = notification_type, message = "", created = datetime.datetime.now(), modified=None)
|
||||
query = SQLQuery.get_notifications_post(schemaModel)
|
||||
|
||||
Reference in New Issue
Block a user