mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 11:40:58 +00:00
Fix email notification setting (#3832)
* Coerce setting value to a boolean * Ignore inactive users when sending notification emails * Only send UI notifications to active users * Fixes for unit tests
This commit is contained in:
@ -267,7 +267,7 @@ class SalesOrderTest(TestCase):
|
||||
category='order.overdue_sales_order',
|
||||
)
|
||||
|
||||
self.assertEqual(len(messages), 2)
|
||||
self.assertEqual(len(messages), 1)
|
||||
|
||||
def test_new_so_notification(self):
|
||||
"""Test that a notification is sent when a new SalesOrder is created.
|
||||
|
@ -326,7 +326,12 @@ class OrderTest(TestCase):
|
||||
user__id=user_id,
|
||||
)
|
||||
|
||||
self.assertTrue(messages.exists())
|
||||
# User ID 3 is inactive, and thus should not receive notifications
|
||||
if user_id == 3:
|
||||
self.assertFalse(messages.exists())
|
||||
continue
|
||||
else:
|
||||
self.assertTrue(messages.exists())
|
||||
|
||||
msg = messages.first()
|
||||
|
||||
|
Reference in New Issue
Block a user