2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

mkae user setting access simpler

This commit is contained in:
Matthias
2022-04-06 23:58:11 +02:00
parent 547c51b81b
commit 4c1a0ea9ce
2 changed files with 8 additions and 3 deletions

View File

@ -114,6 +114,12 @@ class NotificationMethod:
# Lets go!
return False
def usersetting(self, target):
"""
Returns setting for this method for a given user
"""
return NotificationUserSetting.get_setting(f'NOTIFICATION_METHOD_{self.METHOD_NAME.upper()}', user=target, method=self.METHOD_NAME)
# endregion
@ -220,7 +226,7 @@ def trigger_notifaction(obj, category=None, obj_ref='pk', **kwargs):
if NotificationEntry.check_recent(category, obj_ref_value, delta):
logger.info(f"Notification '{category}' has recently been sent for '{str(obj)}' - SKIPPING")
return
# return
logger.info(f"Gathering users for notification '{category}'")
# Collect possible targets