Fix raising on nullable fields part of UniqueConstraint#9531
Fix raising on nullable fields part of UniqueConstraint#9531auvipy merged 5 commits intoencode:masterfrom
UniqueConstraint#9531Conversation
Not really, I've dropped the ball a bit on this one. Will try to make some progress... |
|
Is a new version expected with this fix and others related like #9360 ? The support for UniqueConstraint is not complete and may cause issues… |
|
thanks! |
|
I'm not entirely sure under which circumstances, but this change turns a I'll keep investigating. |
|
Here is a (minimal???) reproducer: def test_tba():
class TestModel(models.Model):
field_1 = models.IntegerField(null=True)
field_2 = models.IntegerField(null=True)
class Meta:
unique_together = (("field_1", "field_2"),)
class TestSerializer(serializers.ModelSerializer):
field_1 = serializers.SerializerMethodField()
def get_field_1(self) -> str:
return "TEST"
class Meta:
model = TestModel
fields = ["field_1", "field_2"]
fields = TestSerializer().fields
assert isinstance(fields["field_1"], serializers.SerializerMethodField) |
Seeing the same thing in my codebase when upgrading to 3.16! |
Description
Fix #9378