summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorWill Koster <ddsnowboard@gmail.com>2016-05-25 15:33:35 -0500
committerTim Graham <timograham@gmail.com>2016-06-03 10:00:53 -0400
commit9899347641b2d3b4457cc99203a2b06504b32a16 (patch)
tree0d6852e40b18d011d3e9db16d68569f8d5c436f3 /django
parent44c7e5d3740edf796591ea3a89b0ff085534f225 (diff)
Fixed #26638 -- Allowed callable arguments for QuerySet.get_or_create()/update_or_create() defaults.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/query.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 2f4ef52e6c..40f7ae6ea9 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -500,6 +500,7 @@ class QuerySet(object):
"""
try:
with transaction.atomic(using=self.db):
+ params = {k: v() if callable(v) else v for k, v in params.items()}
obj = self.create(**params)
return obj, True
except IntegrityError: