Skip to content

UniqueTogetherValidator does not comply to Database standards #9370

@gabn88

Description

@gabn88

Checklist

  • This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
  • I have reduced the issue to the simplest possible case.

If you have a database unique constraint that includes a nullable field, DRF will still raise an 'field_A and field_B must make a unique set' validationerror when you try to post a new nullable field. Whereas on database level every NULL is considered unique.

Could be fixed maybe here in the code:

def filter_queryset(self, attrs, queryset, serializer):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions