Document.objects.create should raise NotUniqueError upon saving duplicate primary key (#1485)
This commit is contained in:
committed by
Stefan Wójcik
parent
5f43c032f2
commit
398964945a
@@ -286,7 +286,7 @@ class BaseQuerySet(object):
|
||||
|
||||
.. versionadded:: 0.4
|
||||
"""
|
||||
return self._document(**kwargs).save()
|
||||
return self._document(**kwargs).save(force_insert=True)
|
||||
|
||||
def first(self):
|
||||
"""Retrieve the first object matching the query."""
|
||||
|
||||
Reference in New Issue
Block a user