X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Factions.py;h=cc4d9886fa898f99e46c41848d696c39a76ccf83;hb=37dd62b23f0024dff481c39804b60198363772c9;hp=a96dfd63e0bd9c67a3f84bba6e673373faa147dd;hpb=770855394e23c5fc3e7862fe5bc7a4cd34476015;p=unfold.git diff --git a/portal/actions.py b/portal/actions.py index a96dfd63..cc4d9886 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -686,6 +686,10 @@ def portal_validate_request(wsgi_request, request_ids): user_email = a.email PendingAuthority.objects.get(id=request['id']).delete() + + # Clear Admin Cache as it is used to display the list of authorities in Registration page + query = Query.update('myslice:authority').filter_by('authority_hrn', '==', sfa_authority_params['authority_hrn']).set({'authority_hrn':sfa_authority_params['authority_hrn']}).select('authority_hrn') + res = execute_admin_query(request, query) elif request['type'] == 'project': hrn = request['authority_hrn'] + '.' + request['project_name'] @@ -712,6 +716,11 @@ def portal_validate_request(wsgi_request, request_ids): PendingProject.objects.get(id=request['id']).delete() + # Clear Admin Cache as it is used to display the list of projects in Slice request page + query = Query.update('myslice:authority').filter_by('authority_hrn', '==', sfa_authority_params['authority_hrn']).set({'authority_hrn':sfa_authority_params['authority_hrn']}).select('authority_hrn') + res = execute_admin_query(request, query) + + elif request['type'] == 'join': # Add user as a PI of the project # Clear user's Credentials @@ -882,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', '') @@ -891,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") @@ -1040,17 +1051,20 @@ 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) + sender = sender.replace('\n', '') msg = EmailMultiAlternatives(subject, text_content, sender, recipients) 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"