Don't try to send notification email if assigned_to is blank
- Supports unassigned tasks
This commit is contained in:
parent
5cbfc554ee
commit
91c0075ccf
2 changed files with 14 additions and 15 deletions
|
@ -10,9 +10,6 @@ Note: {{ task.note }}
|
||||||
{% endautoescape %}
|
{% endautoescape %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Task details/comments:
|
Task details/comments:
|
||||||
http://{{ site }}{% url 'todo:task_detail' task.id %}
|
http://{{ site }}{% url 'todo:task_detail' task.id %}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,9 @@ def toggle_deleted(request, deleted_items):
|
||||||
|
|
||||||
|
|
||||||
def send_notify_mail(request, new_task):
|
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()
|
current_site = Site.objects.get_current()
|
||||||
email_subject = render_to_string("todo/email/assigned_subject.txt", {'task': new_task})
|
email_subject = render_to_string("todo/email/assigned_subject.txt", {'task': new_task})
|
||||||
email_body = render_to_string(
|
email_body = render_to_string(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue