[Django] #27733: ClearableFileInput widget renders incorrectly

22 views
Skip to first unread message

Django

unread,
Jan 13, 2017, 5:31:55 PM1/13/17
to django-...@googlegroups.com
#27733: ClearableFileInput widget renders incorrectly
-------------------------------------+-------------------------------------
Reporter: Luca De | Owner: nobody
Feo |
Type: Bug | Status: new
Component: Forms | Version: 1.10
Severity: Normal | Keywords: forms widgets file
Triage Stage: | input
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The `forms.widgets.ClearableFileInput` widget (used, e.g., by the admin
app) renders as

{{{
<a href="<bound method FieldFile.url of <FieldFile: EXAMPLE>>">EXAMPLE</a>
}}}

with the `href` attribute obviously mis-generated.

Using Django 1.10. This line seems to be the culprit:
https://github.com/django/django/blob/1.10.5/django/forms/widgets.py#L400

--
Ticket URL: <https://code.djangoproject.com/ticket/27733>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 14, 2017, 4:23:02 AM1/14/17
to django-...@googlegroups.com
#27733: ClearableFileInput widget renders incorrectly
-------------------------------------+-------------------------------------
Reporter: Luca De Feo | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Normal | Resolution: needsinfo

Keywords: forms widgets file | Triage Stage:
input | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

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


Comment:

`FieldFile.url` is a property, not a method, see
https://github.com/django/django/blob/1.10.5/django/db/models/fields/files.py#L70

Are you using a third-party FieldFile class?

--
Ticket URL: <https://code.djangoproject.com/ticket/27733#comment:1>

Django

unread,
Jan 14, 2017, 9:04:29 AM1/14/17
to django-...@googlegroups.com
#27733: ClearableFileInput widget renders incorrectly
-------------------------------------+-------------------------------------
Reporter: Luca De Feo | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Normal | Resolution: needsinfo

Keywords: forms widgets file | Triage Stage:
input | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Luca De Feo):

You are totally right. I don't know how it had been working for so long
before. Maybe it used to be a method before 1.10?

--
Ticket URL: <https://code.djangoproject.com/ticket/27733#comment:2>

Django

unread,
Jan 14, 2017, 10:42:04 AM1/14/17
to django-...@googlegroups.com
#27733: ClearableFileInput widget renders incorrectly
-------------------------------------+-------------------------------------
Reporter: Luca De Feo | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Normal | Resolution:
| worksforme

Keywords: forms widgets file | Triage Stage:
input | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* resolution: needsinfo => worksforme


Comment:

It has been a property for a long time (or always has), but as long as it
used in templates only, it doesn't make a big difference. What might be
new is its usage in Python code.

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

Django

unread,
Jan 14, 2017, 10:43:40 AM1/14/17
to django-...@googlegroups.com
#27733: ClearableFileInput widget renders incorrectly
-------------------------------------+-------------------------------------
Reporter: Luca De Feo | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Normal | Resolution:
| worksforme

Keywords: forms widgets file | Triage Stage:
input | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Luca De Feo):

I see. Thanks, and sorry for the noise.

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

Reply all
Reply to author
Forward
0 new messages