Skip to content
Browse files

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

… **kwargs)` form.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent f66853b commit a7d1c73ad9eca3010768153e3e71453dbe32267a @jacobian jacobian committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/contrib/admin/
5 django/contrib/admin/
@@ -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
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:

0 comments on commit a7d1c73

Please sign in to comment.
Something went wrong with that request. Please try again.