Fix a bug: phone_number was stored at an appropriate place
authorGu1 <gu1@cafai.fr>
Fri, 12 Apr 2013 17:48:01 +0000 (19:48 +0200)
committerGu1 <gu1@cafai.fr>
Fri, 12 Apr 2013 17:48:01 +0000 (19:48 +0200)
fdneligibility/views.py
setup.py

index a380376..c341792 100644 (file)
@@ -67,7 +67,7 @@ class EligibilityWizard(SessionWizardView):
             rejets=re.sub(r'&lt;(/?(?:i|b|br))&gt;', r'<\1>', rejets)
             context.update({'unavailable_plans': clean(rejets, tags=['p', 'b', 'i'], strip=True)})
             context.update({
-                'phone_number': self.__phone_number,
+                'phone_number': self.storage.extra_data['phone_number'],
                 'line_info': self.storage.extra_data['si_res']['info_ligne']
             })
         return context
@@ -78,11 +78,6 @@ class EligibilityWizard(SessionWizardView):
             kwargs['si_res']=self.storage.extra_data['si_res']
         return kwargs
 
-    def process_step(self, form):
-        if self.steps.current == '0':
-            self.__phone_number = form.cleaned_data['phone_number']
-        return super(EligibilityWizard, self).process_step(form)
-
     def render_next_step(self, form, **kwargs):
         from django.forms.forms import NON_FIELD_ERRORS
         if self.steps.current == '0': # hackish way to process data and still control the form displayed next
@@ -113,7 +108,7 @@ class EligibilityWizard(SessionWizardView):
                         o['upload'] = self.plans_upload[o['code_offre']]
                     except KeyError:
                         o['upload'] = u'?'
-                self.storage.extra_data={'si_res': si_res}
+                self.storage.extra_data={'si_res': si_res, 'phone_number': phone_number}
             except (HTTPException, SSLError), e:
                 form._errors[NON_FIELD_ERRORS] = form.error_class([_(u"Could not test your eligibility")])
                 return self.render(form)
index c9e759c..fcd3b12 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -33,5 +33,8 @@ setup(
         'Topic :: Internet :: WWW/HTTP',
         'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
     ],
+    install_requires=[
+        'bleach',
+    ]
     zip_safe = False,
 )