diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-08 09:44:13 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-08 09:44:13 +0200 | 
| commit | 0a221f17177ae33f9c3ada1f31831935739facee (patch) | |
| tree | 27c80b1b4f4c239911a098cae349df46bc160441 | |
| parent | 46017fd59b90d99ab5d67d3b9579b1a66198a5e9 (diff) | |
| download | Ishtar-0a221f17177ae33f9c3ada1f31831935739facee.tar.bz2 Ishtar-0a221f17177ae33f9c3ada1f31831935739facee.zip  | |
Wizards: fix file initialization when navigating between steps (refs #2927)
| -rw-r--r-- | ishtar_common/static/media/style.css | 1 | ||||
| -rw-r--r-- | ishtar_common/wizards.py | 11 | 
2 files changed, 6 insertions, 6 deletions
diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index beff03393..4de3cd315 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -630,6 +630,7 @@ ul.form-flex li li label {      margin-left:auto;      margin-right:auto;      background-color:#F1F2F6; +    min-width: 600px;  }  .form table th{ diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 002eeeb57..c8467ca61 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -32,7 +32,7 @@ from django.db.models.fields.files import FileField  from django.db.models.fields.related import ManyToManyField  from django.http import HttpResponseRedirect  from django.forms import ValidationError -from django.shortcuts import render_to_response +from django.shortcuts import render_to_response, redirect  from django.template import Context, RequestContext, loader  from django.utils.datastructures import MultiValueDict as BaseMultiValueDict  from django.utils.translation import ugettext_lazy as _ @@ -653,7 +653,7 @@ class Wizard(NamedUrlWizardView):          return (to_delete, not_to_delete)      def get_form(self, step=None, data=None, files=None): -        """Manage formset""" +        # Manage formset          if data:              data = data.copy()              if not step: @@ -716,6 +716,7 @@ class Wizard(NamedUrlWizardView):                  #    for k in init[0]:                  #        data[step + '-' + unicode(total_field) + '-' + k] = \                  #                                                      init[0][k] +          data = data or None          form = super(Wizard, self).get_form(step, data, files)          # add autofocus to first field @@ -744,6 +745,7 @@ class Wizard(NamedUrlWizardView):                      if frm.fields[key].widget.source_full is not None:                          frm.fields[key].widget.source_full = unicode(                              frm.fields[key].widget.source_full) + "own/" +          return form      def render_next_step(self, form, **kwargs): @@ -781,10 +783,7 @@ class Wizard(NamedUrlWizardView):          except (ValueError, IndexError):              return super(Wizard, self).post(*args, **kwargs)          self.storage.current_step = wizard_goto_step -        form = self.get_form( -            data=self.storage.get_step_data(self.steps.current), -            files=self.storage.get_step_files(self.steps.current)) -        return self.render(form) +        return redirect(self.get_step_url(wizard_goto_step))      def session_get_keys(self, form_key):          """Get list of available keys for a specific form  | 
