Skip to content
Permalink
Browse files

Merge pull request #230 from EE/develop

Master
  • Loading branch information...
SupraSummus committed Aug 14, 2019
2 parents 1e9c744 + 639bd94 commit 0f38bc93080ed0dab3d552ce72223e9ee45a7e49
Showing with 4 additions and 10 deletions.
  1. +4 −10 ee_site/apps/main/forms.py
@@ -5,7 +5,6 @@
from django import forms
from django.conf import settings
from django.core.mail import EmailMessage
from django.core.validators import validate_email, ValidationError
from django.utils.translation import gettext as _

from simple_salesforce.exceptions import SalesforceError
@@ -33,9 +32,9 @@


class ContactForm(forms.Form):
reply_to = forms.CharField(
reply_to = forms.EmailField(
required=True,
label=_('email or phone number'),
label=_('email'),
)
subject = forms.ChoiceField(
required=True,
@@ -124,18 +123,13 @@ def process_offer(self):
).send()

lead = {
'email': self.cleaned_data['reply_to'],
'company': self.cleaned_data['organization_name'],
'status': 'new',
'lastname': '-',
'desire__c': self.cleaned_data['message'],
}

# reply_to may be either email or phone number
try:
validate_email(self.cleaned_data['reply_to'])
lead['email'] = self.cleaned_data['reply_to']
except ValidationError:
lead['phone'] = self.cleaned_data['reply_to']

try:
salesforce.Lead.create(lead)
except SalesforceError:

0 comments on commit 0f38bc9

Please sign in to comment.
You can’t perform that action at this time.