Leaklens

django__django-11999

Cannot override get_FOO_display() in Django 2.2+.

Verdict: the fix is stated in the issue (Tier A).

if not hasattr(cls, 'get_%s_display' % self.name): setattr(cls, 'get_%s_display' % self.name, partialmethod(cls._get_FIELD_display, field=self))

The text states the fix: “if not hasattr(cls, 'get_%s_display' % self.name): setattr(cls, 'get_%s_display' % self.name, partialmethod(cls._get_FIELD_display, field=self))”

All SWE-bench Verified tasks · more django/django tasks · How the check works