Fix things

This commit is contained in:
Jan Tuomi
2017-10-12 00:56:28 +03:00
parent d6239139e0
commit e8fafeda84
12 changed files with 156 additions and 65 deletions
+7 -5
View File
@@ -139,10 +139,12 @@ def kaehmy_submit(request, *args, **kwargs):
application = form.save()
custom_name = form.cleaned_data.get('custom_role_name')
custom_is_board = form.cleaned_data.get('custom_role_is_board')
custom_role = CustomKaehmyRole(
name=custom_name, is_board=custom_is_board)
custom_role.save()
application.custom_roles.add(custom_role)
if len(custom_name) > 0:
custom_role = CustomKaehmyRole(
name=custom_name, is_board=custom_is_board)
custom_role.save()
application.custom_roles.add(custom_role)
email = form.cleaned_data.get('email', '')
name = form.cleaned_data.get('name', 'Anonymous')
@@ -151,7 +153,7 @@ def kaehmy_submit(request, *args, **kwargs):
'Mahdollisista kommenteista tulee ilmoitus sähköpostitse.\r\n\r\n'
'Käy katsomassa kaehmytilanne osoitteessa http://sika.sahkoinsinoorikilta.fi/kaehmy').format(name)
# send_email(email, subject, body)
send_email(email, subject, body)
logging.debug('Sent kaehmy email to recipient <{}>'.format(email))
else:
context = {