Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Changed AutoField.contribute_to_class() to use 'assert…

…' instead of 'if'

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5dda10f2ef67f85d7a716141d1b88b5a19cebdd2 1 parent c7fc2bf
Adrian Holovaty authored January 17, 2006

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

  1. 3  django/db/models/fields/__init__.py
3  django/db/models/fields/__init__.py
@@ -345,8 +345,7 @@ def get_manipulator_new_data(self, new_data, rel=False):
345 345
         return Field.get_manipulator_new_data(self, new_data, rel)
346 346
 
347 347
     def contribute_to_class(self, cls, name):
348  
-        if cls._meta.has_auto_field:
349  
-            raise AssertionError, "A model can't have more than one AutoField."
  348
+        assert not cls._meta.has_auto_field, "A model can't have more than one AutoField."
350 349
         super(AutoField, self).contribute_to_class(cls, name)
351 350
         cls._meta.has_auto_field = True
352 351
 

0 notes on commit 5dda10f

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