Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10076 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 75b286798f07eea7f7edca6356e7fed1202f32c1 1 parent 6b85095
@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
@@ -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
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.