wf: do not notify inactive users (#42428)
This commit is contained in:
parent
248b0c2801
commit
612bfb1ea1
|
@ -4568,6 +4568,14 @@ def test_notifications(pub, http_requests):
|
|||
'https://portal/api/notification/add/?NameID=xxy1',
|
||||
'https://portal/api/notification/add/?NameID=xxy2'])
|
||||
|
||||
# test inactive users are ignored
|
||||
user2.is_active = False
|
||||
user2.store()
|
||||
http_requests.empty()
|
||||
item.perform(formdata)
|
||||
assert http_requests.count() == 1
|
||||
assert set(x['url'] for x in http_requests.requests) == set(['https://portal/api/notification/add/?NameID=xxy1'])
|
||||
|
||||
|
||||
def test_workflow_field_migration(pub):
|
||||
Workflow.wipe()
|
||||
|
|
|
@ -140,7 +140,7 @@ class SendNotificationWorkflowStatusItem(WebserviceCallStatusItem):
|
|||
users.extend(get_publisher().user_class.get_users_with_role(role.id))
|
||||
|
||||
for user in users:
|
||||
if not user:
|
||||
if not user or not user.is_active:
|
||||
continue
|
||||
for name_id in (user.name_identifiers or []):
|
||||
self.qs_data = {'NameID': name_id}
|
||||
|
|
Loading…
Reference in New Issue