Skip to content

Model defaults ignored on empty text field or empty boolean field. #1101

Closed
@ZeaQQ4Ug

Description

@ZeaQQ4Ug

My tables has boolean fields like below.

enabled = models.BooleanField(default=True)

and save it using a serializer in a view class without passing the enabled field in the request.

serializer = SomeSerializer(data=request.DATA)
        if serializer.is_valid():
            object = serializer.save()

the result is object.enabled == False.

I've updated the framework to version 2.3.8 then the issue started occurring. Everything works fine in 2.3.7.

Affected versions >= 2.3.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions