diff --git a/taskapp/handle.py b/taskapp/handle.py index 247342a..5e1cb91 100644 --- a/taskapp/handle.py +++ b/taskapp/handle.py @@ -26,10 +26,10 @@ def handle(task, author, recipient, abon_group): dst_account = author fulltext="%s: %s. " % (text, task.abon.get_full_name()) if task.abon: - fulltext += _('address %(task.abon.address)s. telephone %(task.abon.telephone)s. ') % ( - task.abon.address, task.abon.telephone + fulltext += _('address %s. telephone %s. ') % ( + task.abon.street.name if task.abon.street is not None else '', task.abon.telephone ) - fulltext += _('locality %(abon_group.title)s. Task type - %(task.get_mode_display)s. ') % (abon_group.title, task.get_mode_display()) + fulltext += _('locality %s. Task type - %s.') % (abon_group.title, task.get_mode_display()) fulltext += task.descr if task.descr else _('Not assigned') send_notify(fulltext, dst_account) except ChatException as e: diff --git a/taskapp/views.py b/taskapp/views.py index 5b5bcd7..aafbf8d 100644 --- a/taskapp/views.py +++ b/taskapp/views.py @@ -153,6 +153,8 @@ def task_add_edit(request, task_id=0): messages.error(request, _('Employee has not yet signed up for notifications')) except Abon.DoesNotExist: messages.warning(request, _("User '%s' does not exist") % str(uid)) + except TaskException as e: + messages.error(request, e) return render(request, 'taskapp/add_edit_task.html', { 'form': frm,