[Django] #36952: Fix alter_field when called on a field that not has attribute: concrete

2 views
Skip to first unread message

Django

unread,
Feb 25, 2026, 3:50:55 PM (19 hours ago) Feb 25
to django-...@googlegroups.com
#36952: Fix alter_field when called on a field that not has attribute: concrete
-------------------------------------+-------------------------------------
Reporter: kenshin6x | Type:
| Uncategorized
Status: new | Component: Database
| layer (models, ORM)
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Fix alter_field when called on a field that not has attribute: concrete

When alter_field on class BaseDatabaseSchemaEditor is called on a field
that not has attribute concrete, a exception is raised:
AttributeError: 'BooleanField' object has no attribute 'concrete'

Should avoid this exception by checking if the field has the attribute.
--
Ticket URL: <https://code.djangoproject.com/ticket/36952>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 25, 2026, 3:55:29 PM (19 hours ago) Feb 25
to django-...@googlegroups.com
#36952: Fix alter_field when called on a field that not has attribute: concrete
-------------------------------------+-------------------------------------
Reporter: kenshin6x | Owner: (none)
Type: Uncategorized | Status: new
Component: Database layer | Version: 6.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by kenshin6x):

Patch: https://github.com/django/django/pull/20769
--
Ticket URL: <https://code.djangoproject.com/ticket/36952#comment:1>

Django

unread,
Feb 25, 2026, 4:01:26 PM (19 hours ago) Feb 25
to django-...@googlegroups.com
#36952: Fix alter_field when called on a field that not has attribute: concrete
-------------------------------------+-------------------------------------
Reporter: kenshin6x | Owner: (none)
Type: Uncategorized | Status: closed
Component: Database layer | Version: 6.0
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* resolution: => needsinfo
* status: new => closed

Comment:

`Field.concrete` is set at `Field.set_attributes_from_name` time which
should be systematically called before passing objects to the schema
editor.

If there is a core code path that doesn't do so that's likely where the
bug lies and not in the schema editor itself.

Given you haven't provided any way to reproduce the problem that
demonstrate Django is at fault I'll close the ticket and the associated PR
for now.

Please re-open if you can provide a clear example where Django calls
`alter_field` with a `Field` instance that hasn't been prepared with a
prior `set_attributes_from_name` call.
--
Ticket URL: <https://code.djangoproject.com/ticket/36952#comment:2>

Django

unread,
Feb 25, 2026, 4:02:03 PM (19 hours ago) Feb 25
to django-...@googlegroups.com
#36952: Fix alter_field when called on a field that not has attribute: concrete
-------------------------------------+-------------------------------------
Reporter: kenshin6x | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 6.0
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by kenshin6x):

* stage: Unreviewed => Ready for checkin
* type: Uncategorized => Bug

--
Ticket URL: <https://code.djangoproject.com/ticket/36952#comment:3>

Django

unread,
Feb 25, 2026, 4:03:45 PM (19 hours ago) Feb 25
to django-...@googlegroups.com
#36952: Fix alter_field when called on a field that not has attribute: concrete
-------------------------------------+-------------------------------------
Reporter: kenshin6x | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 6.0
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* has_patch: 1 => 0
* stage: Ready for checkin => Unreviewed

Comment:

Please refer to the contributor documentation;
[https://docs.djangoproject.com/en/6.0/internals/contributing/triaging-
tickets/#ready-for-checkin you can't mark your own patch as RFC]
certaintly not before they are even accepted.
--
Ticket URL: <https://code.djangoproject.com/ticket/36952#comment:4>
Reply all
Reply to author
Forward
0 new messages