[Django] #22299: Wizard storage should delete temp files when reset

26 views
Skip to first unread message

Django

unread,
Mar 21, 2014, 3:37:42 AM3/21/14
to django-...@googlegroups.com
#22299: Wizard storage should delete temp files when reset
------------------------------------------------+------------------------
Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.formtools | Version: master
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 |
------------------------------------------------+------------------------
In order to keep reference to files uploaded through forms during a step
submission files are temporally stored using the declared `file_storage`.

[https://docs.djangoproject.com/en/1.6/ref/contrib/formtools/form-wizard
/#wizard-files As documented], those temporary files are never deleted,
even upon wizard reset or completion.

I understand that it's not possible to clean temporary files in all cases
(i.e. incomplete wizard) but I think we should try to cleanup after
ourselves when possible. That is when `storage.reset` is explicitly
called.

Attaching a PR with a test and a documentation admonition.

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

Django

unread,
Mar 21, 2014, 3:39:50 AM3/21/14
to django-...@googlegroups.com
#22299: Wizard storage should delete temp files when reset
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: contrib.formtools | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by charettes):

See https://github.com/django/django/pull/2451

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

Django

unread,
Mar 21, 2014, 4:09:05 AM3/21/14
to django-...@googlegroups.com
#22299: Wizard storage should delete temp files when reset
--------------------------------------+------------------------------------

Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.formtools | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by erikr):

* stage: Unreviewed => Accepted


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

Django

unread,
Mar 22, 2014, 6:17:31 AM3/22/14
to django-...@googlegroups.com
#22299: Wizard storage should delete temp files when reset
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: master
Component: contrib.formtools | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by erikr):

* stage: Accepted => Ready for checkin


Comment:

Looks fine to me. With updated pull request, tests succeed on Python 2 and
3.

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

Django

unread,
Mar 22, 2014, 5:50:21 PM3/22/14
to django-...@googlegroups.com
#22299: Wizard storage should delete temp files when reset
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: contrib.formtools | Resolution: fixed

Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette <charette.s@…>):

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


Comment:

In [changeset:"fa8b4735287c92b03d23823de8a4e1168d1951d9"]:
{{{
#!CommitTicketReference repository=""
revision="fa8b4735287c92b03d23823de8a4e1168d1951d9"
Fixed #22299 -- Cleanup wizard temp files when possible.

Thanks to @erikr for the review.
}}}

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

Django

unread,
May 30, 2014, 4:26:32 PM5/30/14
to django-...@googlegroups.com
#22299: Wizard storage should delete temp files when reset
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody

Type: | Status: closed
Cleanup/optimization | Version: master
Component: contrib.formtools | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Florian Apolloner <florian@…>):

In [changeset:"c95a3fadb7356e766fe48fae69ce81355180f46a"]:
{{{
#!CommitTicketReference repository=""
revision="c95a3fadb7356e766fe48fae69ce81355180f46a"
[1.7.x] Fixed #22299 -- Cleanup wizard temp files when possible.

Thanks to @erikr for the review.

Backport of fa8b4735287c92b03d23823de8a4e1168d1951d9 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22299#comment:5>

Reply all
Reply to author
Forward
0 new messages