Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[1.0.X] `ModelAdmin` validation now runs when using the `site.registe…

…r(Model, **kwargs)` form.

Backport if [10074] from trunk.

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

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