Browse Source

raise Http404 if an unknown form is being queried

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
11f3ac521b
  1. 5
      pyweb/extdirect.py

5
pyweb/extdirect.py

@ -22,7 +22,7 @@ import traceback
from sys import stderr from sys import stderr
from django import forms from django import forms
from django.http import HttpResponse
from django.http import HttpResponse, Http404
from django.conf import settings from django.conf import settings
from django.conf.urls.defaults import patterns, url from django.conf.urls.defaults import patterns, url
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
@ -388,6 +388,9 @@ class Provider( object ):
def get_form( self, request, formname ): def get_form( self, request, formname ):
""" Convert the form given in "formname" to an ExtJS FormPanel. """ """ Convert the form given in "formname" to an ExtJS FormPanel. """
if formname not in self.forms:
raise Http404(formname)
items = [] items = []
clsname = self.forms[formname].__name__ clsname = self.forms[formname].__name__
hasfiles = False hasfiles = False

Loading…
Cancel
Save