Created
August 8, 2013 09:51
-
-
Save loic/6183305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py | |
| index fb4cbbb..029b0ee 100644 | |
| --- a/django/db/models/fields/__init__.py | |
| +++ b/django/db/models/fields/__init__.py | |
| @@ -677,8 +677,9 @@ class AutoField(Field): | |
| } | |
| def __init__(self, *args, **kwargs): | |
| - assert kwargs.get('primary_key', False) is True, \ | |
| - "%ss must have primary_key=True." % self.__class__.__name__ | |
| + assert kwargs.get('primary_key', True) is True, \ | |
| + "%ss must have primary_key=True." % self.__class__.__name__ | |
| + kwargs['primary_key'] = True | |
| kwargs['blank'] = True | |
| Field.__init__(self, *args, **kwargs) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment