mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-24 10:34:03 +03:00
Default nullable fields to null in unique constraints checks
This commit is contained in:
parent
2bf6c7df6d
commit
25e01d0761
|
@ -1490,6 +1490,8 @@ class ModelSerializer(Serializer):
|
||||||
default = timezone.now
|
default = timezone.now
|
||||||
elif unique_constraint_field.has_default():
|
elif unique_constraint_field.has_default():
|
||||||
default = unique_constraint_field.default
|
default = unique_constraint_field.default
|
||||||
|
elif unique_constraint_field.null:
|
||||||
|
default = None
|
||||||
else:
|
else:
|
||||||
default = empty
|
default = empty
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user