kopia lustrzana https://github.com/rtts/django-simplecms
Allow form sections to return http responses
rodzic
2b9c9d9a14
commit
89600bad98
|
@ -3,7 +3,7 @@ import swapper
|
|||
|
||||
from django.shortcuts import redirect
|
||||
from django.views.generic import base, detail, edit
|
||||
from django.http import Http404, HttpResponseRedirect
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
@ -93,6 +93,8 @@ class PageView(detail.DetailView):
|
|||
result = section.view.post(request)
|
||||
if isinstance(result, HttpResponseRedirect):
|
||||
return result
|
||||
if isinstance(result, HttpResponse):
|
||||
return result
|
||||
section.context['form'] = result
|
||||
|
||||
context.update({
|
||||
|
|
Ładowanie…
Reference in New Issue