From: Loic Baron Date: Tue, 28 Apr 2015 14:44:46 +0000 (+0200) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.4~32 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=00446adb7d1cd10387002c24cf1fa267fe655d28;hp=8adb4f97263a66a2a2cf151cf8d3ab5569d365f3;p=myslice.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab --- diff --git a/portal/actions.py b/portal/actions.py index a6b33a57..cc4d9886 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -891,6 +891,7 @@ def send_status_email(ctx, user_email, obj_type, status): 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', '') @@ -900,6 +901,7 @@ def send_status_email(ctx, user_email, obj_type, status): 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") @@ -1049,9 +1051,10 @@ def send_email_to_pis(wsgi_request, request, obj_type): 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) @@ -1061,6 +1064,7 @@ def send_email_to_pis(wsgi_request, request, obj_type): 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" diff --git a/portal/projectrequestview.py b/portal/projectrequestview.py index 69941b32..3d749c85 100644 --- a/portal/projectrequestview.py +++ b/portal/projectrequestview.py @@ -140,7 +140,7 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): 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