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:
@ -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
|
||||
|
Reference in New Issue
Block a user