From a956536c8e1d9398e7c22738aed04309b4a69909 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 22 Feb 2017 00:15:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BC=20=D1=87=D1=82=D0=BE=20=D0=BD=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D1=8F=20=D1=83=D0=B4=D0=B0=D0=BB=D1=8F=D1=82=D1=8C?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D1=83,=20=D0=BD=D0=B0=D0=B7?= =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=BD=D1=83=D1=8E=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D1=81=D0=B5=D0=B1=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taskapp/locale/ru/LC_MESSAGES/django.po | 3 +++ taskapp/views.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/taskapp/locale/ru/LC_MESSAGES/django.po b/taskapp/locale/ru/LC_MESSAGES/django.po index b0bc3e7..4ae871e 100644 --- a/taskapp/locale/ru/LC_MESSAGES/django.po +++ b/taskapp/locale/ru/LC_MESSAGES/django.po @@ -353,3 +353,6 @@ msgstr "Назначенные мной задачи" msgid "All my tasks" msgstr "Все мои задачи" + +msgid "You cannot delete task that assigned to you" +msgstr "Вы не можете удалять назначенные на вас задачи" diff --git a/taskapp/views.py b/taskapp/views.py index eab3480..89316ba 100644 --- a/taskapp/views.py +++ b/taskapp/views.py @@ -80,6 +80,8 @@ def task_delete(request, task_id): # нельзя удалить назначенную мне задачу if request.user not in task.recipients.all(): task.delete() + else: + messages.warning(request, _('You cannot delete task that assigned to you')) return redirect('taskapp:home')