Author: adrian
Date: 2007-01-14 15:50:00 -0600 (Sun, 14 Jan 2007)
New Revision: 4325
Modified:
django/branches/newforms-admin/django/contrib/admin/views/main.py
Log:
newforms-admin: Changed model_admin_view() to raise Http404 for models with no
admin interface
Modified: django/branches/newforms-admin/django/contrib/admin/views/main.py
===================================================================
--- django/branches/newforms-admin/django/contrib/admin/views/main.py
2007-01-14 20:49:23 UTC (rev 4324)
+++ django/branches/newforms-admin/django/contrib/admin/views/main.py
2007-01-14 21:50:00 UTC (rev 4325)
@@ -110,6 +110,8 @@
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))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django
updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---