1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59: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:
Adrian Holovaty 2007-01-14 21:50:00 +00:00
parent 4dfb224d7e
commit 40256823fd

View File

@ -110,6 +110,8 @@ def model_admin_view(request, app_label, model_name, rest_of_url):
model = models.get_model(app_label, model_name)
if model is None:
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)
return mav(request, rest_of_url)
model_admin_view = staff_member_required(never_cache(model_admin_view))