During an update from Django 4.0.8 to 4.1.3, an unexpected bug occured in
our tests.
{{{
django.core.exceptions.FieldError: Expression contains mixed types:
IntegerField, SmallIntegerField. You must set output_field.
}}}
I understand what it means, but I couldn't find what changed between these
two versions that could explain the appearance of this error.
{{{
Case(
When(
True,
then=F("inventory_count") + Value(1),
),
default=F("inventory_count"),
)
}}}
I could easily fix it with
{{{
Case(
When(
True,
then=F("inventory_count") + Value(1),
),
default=F("inventory_count"),
output_field=IntegerField(),
)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34160>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.