Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
Jacob Kaplan-Moss authored March 17, 2009

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  django/contrib/admin/sites.py
5  django/contrib/admin/sites.py
@@ -49,14 +49,15 @@ def register(self, model_or_iterable, admin_class=None, **options):
49 49
 
50 50
         If a model is already registered, this will raise AlreadyRegistered.
51 51
         """
  52
+        if not admin_class:
  53
+            admin_class = ModelAdmin
  54
+
52 55
         # Don't import the humongous validation code unless required
53 56
         if admin_class and settings.DEBUG:
54 57
             from django.contrib.admin.validation import validate
55 58
         else:
56 59
             validate = lambda model, adminclass: None
57 60
 
58  
-        if not admin_class:
59  
-            admin_class = ModelAdmin
60 61
         if isinstance(model_or_iterable, ModelBase):
61 62
             model_or_iterable = [model_or_iterable]
62 63
         for model in model_or_iterable:

0 notes on commit 75b2867

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