mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
Fix non-determanistic default bug. Closes #2099.
This commit is contained in:
parent
40b1ea919b
commit
bde7255413
|
@ -757,7 +757,7 @@ class ModelSerializer(Serializer):
|
|||
elif getattr(unique_constraint_field, 'auto_now', None):
|
||||
default = timezone.now
|
||||
elif unique_constraint_field.has_default():
|
||||
default = model_field.default
|
||||
default = unique_constraint_field.default
|
||||
else:
|
||||
default = empty
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user