From 7b49f9b0b82bbe05330a98765e2058aea56d169d Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Tue, 25 Apr 2023 09:52:57 +0200 Subject: [PATCH] fixup: Send notifications via django-q2 (fixes tests) --- src/argus/notificationprofile/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/argus/notificationprofile/models.py b/src/argus/notificationprofile/models.py index 78f605808..e1212d2f1 100644 --- a/src/argus/notificationprofile/models.py +++ b/src/argus/notificationprofile/models.py @@ -170,7 +170,8 @@ class Meta: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.filter_wrapper = FilterWrapper(self.filter, self.user) + user = getattr(self, 'user', None) + self.filter_wrapper = FilterWrapper(self.filter, user) def __str__(self): return f"{self.name} [{self.filter_string}]"