Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

`ModelAdmin` validation now runs when using the `site.register(Model,…

… **kwargs)` form.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10074 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a7d1c73ad9eca3010768153e3e71453dbe32267a 1 parent f66853b
@jacobian jacobian authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/contrib/admin/sites.py
View
5 django/contrib/admin/sites.py
@@ -57,14 +57,15 @@ def register(self, model_or_iterable, admin_class=None, **options):
If a model is already registered, this will raise AlreadyRegistered.
"""
+ if not admin_class:
+ admin_class = ModelAdmin
+
# Don't import the humongous validation code unless required
if admin_class and settings.DEBUG:
from django.contrib.admin.validation import validate
else:
validate = lambda model, adminclass: None
- if not admin_class:
- admin_class = ModelAdmin
if isinstance(model_or_iterable, ModelBase):
model_or_iterable = [model_or_iterable]
for model in model_or_iterable:
Please sign in to comment.
Something went wrong with that request. Please try again.