Django

Code

Ticket #7250 (closed: fixed)

Opened 7 months ago

Last modified 4 months ago

Internal data shown when uploading a ImageField fails

Reported by: garcia_marc Assigned to: garcia_marc
Milestone: 1.0 Component: django.contrib.admin
Version: newforms-admin Keywords: nfa nfa-someday
Cc: marc.garcia@accopensys.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 1 Patch needs improvement: 0

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

7250.diff (0.5 kB) - added by garcia_marc on 06/13/08 06:56:07.
Patch that correct the issue

Change History

06/09/08 19:04:49 changed by Karen Tracey <kmtracey@gmail.com>

  • keywords changed from nfa fs-rf to nfa fs-rf nfa-someday.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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

06/13/08 06:56:07 changed by garcia_marc

  • attachment 7250.diff added.

Patch that correct the issue

06/13/08 07:05:53 changed by garcia_marc

  • has_patch set to 1.
  • needs_tests set to 1.

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.

06/16/08 10:55:56 changed by garcia_marc

  • milestone set to 1.0.

06/16/08 11:00:46 changed by ramiro

  • description changed.

06/16/08 12:33:07 changed by Gulopine

  • keywords changed from nfa fs-rf nfa-someday to nfa nfa-someday.

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.

06/27/08 09:26:02 changed by garcia_marc

  • cc changed from garcia_marc to marc.garcia@accopensys.com.
  • owner changed from nobody to garcia_marc.

08/08/08 14:48:16 changed by ericholscher

  • stage changed from Unreviewed to Accepted.

08/09/08 20:07:44 changed by brosner

  • status changed from new to closed.
  • resolution set to fixed.

(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.


Add/Change #7250 (Internal data shown when uploading a ImageField fails)




Change Properties
Action