No need to merge old/new notification messages if messages field is null

This commit is contained in:
Jim Ladd 2019-08-20 23:41:30 -07:00
parent 24a383c7c1
commit c8805cc55b

View File

@ -128,7 +128,7 @@ class NotificationTemplate(CommonModelNameNotUnique):
old_messages = old_nt.messages
new_messages = self.messages
if old_messages is not None:
if old_messages is not None and new_messages is not None:
for event in ['started', 'success', 'error']:
if not new_messages.get(event, {}) and old_messages.get(event, {}):
new_messages[event] = old_messages[event]