Re: [Django] #35657: Specifying db_default on FileField causes crash on instance save

36 views
Skip to first unread message

Django

unread,
Aug 5, 2024, 6:02:45 AM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: assigned
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* has_patch: 0 => 1
* owner: (none) => Sarah Boyce
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
* status: new => assigned

Comment:

I feel like the behavior should mimic default here - accepting
--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 5, 2024, 6:06:05 AM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: assigned
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

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

Django

unread,
Aug 5, 2024, 6:53:49 AM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* has_patch: 1 => 0
* needs_better_patch: 1 => 0
* owner: Sarah Boyce => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:4>

Django

unread,
Aug 5, 2024, 7:47:23 AM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mohammad Salehi):

Hi, I tested this issue and it indeed exists. It can be resolved by
initiating self.name to None in init, and that's it
I would send a PR to address this alongside a test, if you are ok.
--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:5>

Django

unread,
Aug 5, 2024, 8:08:39 AM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce):

Replying to [comment:5 Mohammad Salehi]:
> Hi, I tested this issue and it indeed exists. It can be resolved by
initiating self.name to None in init, and that's it
> I would send a PR to address this alongside a test, if you are ok.

That doesn't sound right
I've opened a PR
--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:6>

Django

unread,
Aug 5, 2024, 8:09:45 AM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: assigned
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* owner: (none) => Sarah Boyce
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:7>

Django

unread,
Aug 5, 2024, 8:10:06 AM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: assigned
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:8>

Django

unread,
Aug 5, 2024, 2:25:28 PM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: assigned
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | 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 Natalia Bidart):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:9>

Django

unread,
Aug 5, 2024, 3:36:59 PM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: db_default | 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 GitHub <noreply@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"8deb6bb1fc427762d56646bf7306cbd11fb5bb68" 8deb6bb1]:
{{{#!CommitTicketReference repository=""
revision="8deb6bb1fc427762d56646bf7306cbd11fb5bb68"
Fixed #35657 -- Made FileField handle db_default values.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:10>

Django

unread,
Aug 5, 2024, 3:38:10 PM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: db_default | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):

In [changeset:"2ba4f4b0b550a98f10deac47c1bbddccbc7365cd" 2ba4f4b0]:
{{{#!CommitTicketReference repository=""
revision="2ba4f4b0b550a98f10deac47c1bbddccbc7365cd"
[5.1.x] Fixed #35657 -- Made FileField handle db_default values.

Backport of 8deb6bb1fc427762d56646bf7306cbd11fb5bb68 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:11>

Django

unread,
Aug 5, 2024, 3:38:55 PM8/5/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: db_default | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):

In [changeset:"d7f955462cb17e74c2a1701ea7f722f2ed2bc168" d7f9554]:
{{{#!CommitTicketReference repository=""
revision="d7f955462cb17e74c2a1701ea7f722f2ed2bc168"
[5.0.x] Fixed #35657 -- Made FileField handle db_default values.

Backport of 8deb6bb1fc427762d56646bf7306cbd11fb5bb68 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:12>

Django

unread,
Aug 10, 2024, 3:25:49 PM8/10/24
to django-...@googlegroups.com
#35657: Specifying db_default on FileField causes crash on instance save
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Sarah
| Boyce
Type: Bug | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: db_default | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mohammad Salehi):

I have created a PR: [https://github.com/django/django/pull/18465]
--
Ticket URL: <https://code.djangoproject.com/ticket/35657#comment:13>
Reply all
Reply to author
Forward
0 new messages