diff --git a/article/admin.py b/article/admin.py index 29b59839..15cc4268 100644 --- a/article/admin.py +++ b/article/admin.py @@ -145,7 +145,7 @@ class BlogList(ListView): class BlogView(FormView): form_class = BlogForm - template_name = 'article/blog_form.html' + template_name = 'admin/article/blog_form.html' success_url = '/admin/article/blog/all/' obj = None diff --git a/article/forms.py b/article/forms.py index e287fd45..88849b80 100644 --- a/article/forms.py +++ b/article/forms.py @@ -21,7 +21,7 @@ class BlogForm(forms.Form): type = Article.blog theme = forms.ModelMultipleChoiceField(label='Тематики', queryset=ThemeBlog.objects.all(), required=False, widget=forms.SelectMultiple(attrs={'style':'width: 550px'})) - slug = forms.SlugField(label=u'URL', max_length=255, min_length=1) + slug = forms.SlugField(label=u'URL', max_length=255, min_length=1, required=False) publish_date = forms.DateField(label=u'Дата публикации', input_formats=['%Y-%m-%d', '%d.%m.%Y'], required=False) tag = forms.CharField(label=u'Теги', widget=forms.HiddenInput(), required=False) logo = forms.ImageField(label=u'Лого', required=False)