Add phone number to customer profile (Z#178346) (#2414)

This commit is contained in:
Richard Schreiber
2022-01-18 11:38:32 +01:00
committed by GitHub
parent cbdafac999
commit 768bb8c106
10 changed files with 150 additions and 73 deletions

View File

@@ -697,7 +697,7 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
self.cart_session.get('email', '') or
wd.get('email', '')
),
'phone': wd.get('phone', None)
'phone': self.cart_session.get('phone', '') or wd.get('phone', None)
}
initial.update(self.cart_session.get('contact_form_data', {}))
@@ -709,6 +709,8 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
if self.cart_customer:
initial['email'] = self.cart_customer.email
initial['email_repeat'] = self.cart_customer.email
if not initial['phone']:
initial['phone'] = str(self.cart_customer.phone)
f = ContactForm(data=self.request.POST if self.request.method == "POST" else None,
event=self.request.event,