From a9cbd6aeb2fdd1883a707aa9e0afdacd652ae236 Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Thu, 9 Feb 2017 09:38:38 +0200 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20=D0=B2=20=D0=B0=D0=B4?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/file/admin.py | 3 +++ templates/c_admin/file/file_update.html | 1 + 2 files changed, 4 insertions(+) diff --git a/apps/file/admin.py b/apps/file/admin.py index 5a2a1b0a..cb8e61d6 100644 --- a/apps/file/admin.py +++ b/apps/file/admin.py @@ -73,3 +73,6 @@ class FileUpdateView(UpdateView): template_name = 'c_admin/file/file_update.html' form_class = FileUpdateForm model = FileModel + + def get_success_url(self): + return reverse('file_update', args=[self.object.pk]) diff --git a/templates/c_admin/file/file_update.html b/templates/c_admin/file/file_update.html index 5b67905e..401b5b33 100644 --- a/templates/c_admin/file/file_update.html +++ b/templates/c_admin/file/file_update.html @@ -2,6 +2,7 @@ {% block body %}
+ {% csrf_token %}
{% if object %} Изменить {% else %} Добавить {% endif %} файл