Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#7250 closed (fixed)

Internal data shown when uploading a ImageField fails

Reported by: garcia_marc Owned by: garcia_marc
Component: contrib.admin Version: newforms-admin
Severity: Keywords: nfa nfa-someday
Cc: marc.garcia@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)

In newforms-admin, when uploading a file that isn't an image to a ImageField field, file internal data is display for "Currently". Shown data is something like {'content': '', 'content-type': 'text/plain', 'filename': 'test.txt'}

Same will happen if anything else fails when uploading to a FileField or a ImageField.

Attachments (1)

7250.diff (545 bytes) - added by garcia_marc 6 years ago.
Patch that correct the issue

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by Karen Tracey <kmtracey@…>

  • Keywords nfa-someday added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Not pretty but not a deal-breaker for merge to trunk.

Changed 6 years ago by garcia_marc

Patch that correct the issue

comment:2 Changed 6 years ago by garcia_marc

  • Has patch set
  • Needs tests set

Cannot add tests with the patch because the difficulty in testing with files on the python shell.

I've tested the patch in the admin, but testing on forms and with ModelForm is still required.

This patch isn't supposed to modify the behavior of file deletion, but it would be recommended to check it.

comment:3 Changed 6 years ago by garcia_marc

  • milestone set to 1.0

comment:4 Changed 6 years ago by ramiro

  • Description modified (diff)

comment:5 Changed 6 years ago by Gulopine

  • Keywords fs-rf removed

The filestorage refactor isn't dealing with the forms side of things. While this probably does need to be addressed, it's not part of fs-rf, so I'm removing the keyword.

comment:6 Changed 6 years ago by garcia_marc

  • Cc marc.garcia@… added; garcia_marc removed
  • Owner changed from nobody to garcia_marc

comment:7 Changed 6 years ago by ericholscher

  • Triage Stage changed from Unreviewed to Accepted

comment:8 Changed 6 years ago by brosner

  • Resolution set to fixed
  • Status changed from new to closed

(In [8277]) Fixed #7250 -- Don't show internal data of a FileField in the admin when the form does not validate. This also alternatively fixes a recent problem since [8244] when the form is not valid. Thanks Marc Garcia for the initial ticket.

comment:9 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.