theme.template_name = obj_type + '_request_' + status + '.html'
html_content = render_to_string(theme.template, ctx)
theme.template_name = 'email_default_sender.txt'
+
sender = render_to_string(theme.template, ctx)
sender = sender.replace('\n', '')
msg.attach_alternative(html_content, "text/html")
msg.send()
except Exception as e:
+ print e
logger.error("Failed to send email, please check the mail templates and the SMTP configuration of your server")
theme.template_name = obj_type + '_request_email.html'
html_content = render_to_string(theme.template, request)
- theme.template_name = obj_type + '_request_email_subject.txt'
- subject = render_to_string(theme.template, request)
- subject = subject.replace('\n', '')
+ #theme.template_name = obj_type + '_request_email_subject.txt'
+ #subject = render_to_string(theme.template, request)
+ #subject = subject.replace('\n', '')
+ subject = "New "+obj_type+" request"
theme.template_name = 'email_default_sender.txt'
sender = render_to_string(theme.template, request)
msg.attach_alternative(html_content, "text/html")
msg.send()
except Exception, e:
+ print e
print "Failed to send email, please check the mail templates and the SMTP configuration of your server"
if not errors:
logger.info("is_pi on auth_hrn = {}".format(user_authority))
- if is_pi(wsgi_request, user_hrn, user_authority):
+ if is_pi(wsgi_request, user_hrn, post['authority_hrn']):
# PIs can directly create/join project in their own authority...
if 'join' in wsgi_request.POST:
# join existing project