Don't try to send notification email if assigned_to is blank

- Supports unassigned tasks
This commit is contained in:
Scot Hacker 2018-02-11 23:01:37 -08:00
parent 5cbfc554ee
commit 91c0075ccf
2 changed files with 14 additions and 15 deletions

View file

@ -10,9 +10,6 @@ Note: {{ task.note }}
{% endautoescape %}
{% endif %}
Task details/comments:
http://{{ site }}{% url 'todo:task_detail' task.id %}

View file

@ -29,7 +29,9 @@ def toggle_deleted(request, deleted_items):
def send_notify_mail(request, new_task):
# Send email
# Send email to assignee when task is assigned to someone else.
# Unassigned tasks should not try to notify.
if new_task.assigned_to:
current_site = Site.objects.get_current()
email_subject = render_to_string("todo/email/assigned_subject.txt", {'task': new_task})
email_body = render_to_string(