|
|
|
@ -11,10 +11,8 @@ EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+")
|
|
|
|
|
|
|
|
|
|
@processor_for("nominierungen")
|
|
|
|
|
def sendNomination(request, page=None):
|
|
|
|
|
print('HOLA')
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST':
|
|
|
|
|
print(request.POST)
|
|
|
|
|
|
|
|
|
|
page = Page.objects.get(slug="nominierungen")
|
|
|
|
|
form_valid = True
|
|
|
|
@ -23,8 +21,7 @@ def sendNomination(request, page=None):
|
|
|
|
|
nominated = request.POST.get('nominated')
|
|
|
|
|
reasons_nomination = request.POST.get('reasons_nomination')
|
|
|
|
|
|
|
|
|
|
# if email != "" and not EMAIL_REGEX.match(email):
|
|
|
|
|
if not EMAIL_REGEX.match(email):
|
|
|
|
|
if email != "" and not EMAIL_REGEX.match(email):
|
|
|
|
|
form_valid = False
|
|
|
|
|
messages.error(request, str(_('Ungültige E-Mail')), extra_tags='email')
|
|
|
|
|
|
|
|
|
@ -43,7 +40,7 @@ def sendNomination(request, page=None):
|
|
|
|
|
|
|
|
|
|
subject = 'Nomination sumbitted'
|
|
|
|
|
message = 'Nominated: ' + nominated + ' Reasons: ' + reasons_nomination
|
|
|
|
|
from_email = email
|
|
|
|
|
from_email = 'no-reply@bba.pep.foundation'
|
|
|
|
|
recipient_list = ['dbe@pep.security']
|
|
|
|
|
|
|
|
|
|
email = EmailMessage(subject, message, from_email, recipient_list)
|
|
|
|
@ -66,7 +63,4 @@ def sendNomination(request, page=None):
|
|
|
|
|
print('email CCC')
|
|
|
|
|
|
|
|
|
|
if is_valid:
|
|
|
|
|
return HttpResponseRedirect('/danke/')
|
|
|
|
|
|
|
|
|
|
print('MESSAGES:')
|
|
|
|
|
print(messages)
|
|
|
|
|
return HttpResponseRedirect('/danke/')
|