mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #6970 -- Raise the original IntegrityError when all required fields aren't specified in get_or_create instead of a misleading DoesNotExist error, thanks deadwisdom.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8398 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -50,4 +50,11 @@ True
|
||||
False
|
||||
>>> Person.objects.count()
|
||||
2
|
||||
|
||||
# If you don't specify a value or default value for all required fields, you
|
||||
# will get an error.
|
||||
>>> p, created = Person.objects.get_or_create(first_name='Tom', last_name='Smith')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
IntegrityError:...
|
||||
"""}
|
||||
|
||||
Reference in New Issue
Block a user