From 10fd8a07446a256af70c2da34e8bac7965999cb8 Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Wed, 22 Apr 2015 19:34:04 +0200 Subject: [PATCH] Clear credentials when granting or revoking PI rights in manage institution page --- portal/static/js/myslice.js | 1 - portal/templates/fed4fire/fed4fire_institution.html | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/portal/static/js/myslice.js b/portal/static/js/myslice.js index 80b4d170..ba3512c2 100644 --- a/portal/static/js/myslice.js +++ b/portal/static/js/myslice.js @@ -186,7 +186,6 @@ var myslice = { // What are the projects under this authority? $.post("/rest/myslice:authority/",{'fields':['authority_hrn'],'filters':{'authority_hrn':'CONTAINS'+auth}}, function( data ) { $.each(data, function(idx, project) { - console.log(project.authority_hrn); if($.inArray(project.authority_hrn,projects) == -1){ projects.push(project.authority_hrn); } diff --git a/portal/templates/fed4fire/fed4fire_institution.html b/portal/templates/fed4fire/fed4fire_institution.html index 182030df..626225cd 100644 --- a/portal/templates/fed4fire/fed4fire_institution.html +++ b/portal/templates/fed4fire/fed4fire_institution.html @@ -288,6 +288,8 @@ $(document).ready(function() { if(this.checked){ var record_id = this.id; pi_users.push(record_id) + $.post("/credentials/clear/",{'emails':[this.dataset['email']]}, function(data) { + }); // post credentials clear flag = true; } }); @@ -318,9 +320,11 @@ $(document).ready(function() { for (var i=pi_users.length-1; i>=0; i--) { if (pi_users[i] === record_id) { pi_users.splice(i, 1); + $.post("/credentials/clear/",{'emails':[this.dataset['email']]}, function(data) { + }); // post credentials clear + flag = true; } } - flag = true; } }); if(flag == true){ @@ -343,6 +347,8 @@ $(document).ready(function() { //alert("Rest Error for "+record_id+": "+data.error); } }); + }else{ + mysliceAlert('No action: User had no rights on: {{user_details.parent_authority}}','success', true); } }); }); -- 2.47.0