|
|
|
|
@ -302,6 +302,7 @@ class FormBuilder(forms.Form): |
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
send = False |
|
|
|
|
contacts = [] |
|
|
|
|
client_mail_to = None |
|
|
|
|
|
|
|
|
|
for data in form_data: |
|
|
|
|
@ -309,14 +310,21 @@ class FormBuilder(forms.Form): |
|
|
|
|
request.session[form_slug] = None |
|
|
|
|
request.session['last-completed-form-id'] = form_instance.id |
|
|
|
|
send = True |
|
|
|
|
|
|
|
|
|
if data['type'] == 'email': |
|
|
|
|
client_mail_to = data['value'] |
|
|
|
|
if client_mail_to: |
|
|
|
|
contacts.append(client_mail_to) |
|
|
|
|
|
|
|
|
|
if data['name'] == 'phone' and data['value']: |
|
|
|
|
contacts.append(data['value']) |
|
|
|
|
|
|
|
|
|
# Simple antispam |
|
|
|
|
if data['name'] == 'phone' and data['value'] == '123456': |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
if not send: |
|
|
|
|
# Some contacts |
|
|
|
|
if not send or len(contacts) == 0: |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
# Send to company |
|
|
|
|
|