diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index b1b7b6477..f37bd3a3d 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -1490,6 +1490,8 @@ class ModelSerializer(Serializer): default = timezone.now elif unique_constraint_field.has_default(): default = unique_constraint_field.default + elif unique_constraint_field.null: + default = None else: default = empty