Commit eee83e3a by Bach Dániel

dashboard: simplify Notification.send

parent 7eb6a33f
...@@ -70,9 +70,7 @@ class Notification(TimeStampedModel): ...@@ -70,9 +70,7 @@ class Notification(TimeStampedModel):
def send(cls, user, subject, template, context, def send(cls, user, subject, template, context,
valid_until=None, subject_context=None): valid_until=None, subject_context=None):
hro = create_readable(template, user=user, **context) hro = create_readable(template, user=user, **context)
if subject_context is None: subject = create_readable(subject, **(subject_context or context))
subject_context = context
subject = create_readable(subject, **subject_context)
return cls.objects.create(to=user, return cls.objects.create(to=user,
subject_data=subject.to_dict(), subject_data=subject.to_dict(),
message_data=hro.to_dict(), message_data=hro.to_dict(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment