mirror of
https://github.com/django/django.git
synced 2025-07-05 02:09:13 +00:00
newforms-admin: Changed model_admin_view() to raise Http404 for models with no admin interface
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4325 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4dfb224d7e
commit
40256823fd
@ -110,6 +110,8 @@ def model_admin_view(request, app_label, model_name, rest_of_url):
|
|||||||
model = models.get_model(app_label, model_name)
|
model = models.get_model(app_label, model_name)
|
||||||
if model is None:
|
if model is None:
|
||||||
raise Http404("App %r, model %r, not found" % (app_label, model_name))
|
raise Http404("App %r, model %r, not found" % (app_label, model_name))
|
||||||
|
if not model._meta.admin:
|
||||||
|
raise Http404("This object has no admin interface.")
|
||||||
mav = ModelAdminView(model)
|
mav = ModelAdminView(model)
|
||||||
return mav(request, rest_of_url)
|
return mav(request, rest_of_url)
|
||||||
model_admin_view = staff_member_required(never_cache(model_admin_view))
|
model_admin_view = staff_member_required(never_cache(model_admin_view))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user