Loading django/contrib/formtools/tests/wizard/storage.py +8 −1 Original line number Diff line number Diff line from datetime import datetime from importlib import import_module import os import tempfile from django.http import HttpRequest from django.conf import settings from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from django.core.files.uploadedfile import SimpleUploadedFile temp_storage_location = tempfile.mkdtemp(dir=os.environ.get('DJANGO_TEST_TEMP_DIR')) temp_storage = FileSystemStorage(location=temp_storage_location) def get_request(): Loading django/contrib/formtools/wizard/storage/base.py +5 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,11 @@ class BaseStorage(object): } def reset(self): # Delete temporary files before breaking reference to them. wizard_files = self.data[self.step_files_key] for step_files in six.itervalues(wizard_files): for step_file in six.itervalues(step_files): self.file_storage.delete(step_file['tmp_name']) self.init_data() def _get_current_step(self): Loading docs/ref/contrib/formtools/form-wizard.txt +3 −3 Original line number Diff line number Diff line Loading @@ -634,9 +634,9 @@ storage class <builtin-fs-storage>`):: .. warning:: Please remember to take care of removing old files as the :class:`WizardView` won't remove any files, whether the wizard gets finished correctly or not. Please remember to take care of removing old temporary files, as the :class:`WizardView` will only remove these files if the wizard finishes correctly. Conditionally view/skip specific steps ====================================== Loading Loading
django/contrib/formtools/tests/wizard/storage.py +8 −1 Original line number Diff line number Diff line from datetime import datetime from importlib import import_module import os import tempfile from django.http import HttpRequest from django.conf import settings from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from django.core.files.uploadedfile import SimpleUploadedFile temp_storage_location = tempfile.mkdtemp(dir=os.environ.get('DJANGO_TEST_TEMP_DIR')) temp_storage = FileSystemStorage(location=temp_storage_location) def get_request(): Loading
django/contrib/formtools/wizard/storage/base.py +5 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,11 @@ class BaseStorage(object): } def reset(self): # Delete temporary files before breaking reference to them. wizard_files = self.data[self.step_files_key] for step_files in six.itervalues(wizard_files): for step_file in six.itervalues(step_files): self.file_storage.delete(step_file['tmp_name']) self.init_data() def _get_current_step(self): Loading
docs/ref/contrib/formtools/form-wizard.txt +3 −3 Original line number Diff line number Diff line Loading @@ -634,9 +634,9 @@ storage class <builtin-fs-storage>`):: .. warning:: Please remember to take care of removing old files as the :class:`WizardView` won't remove any files, whether the wizard gets finished correctly or not. Please remember to take care of removing old temporary files, as the :class:`WizardView` will only remove these files if the wizard finishes correctly. Conditionally view/skip specific steps ====================================== Loading