Added a reset for api key

This commit is contained in:
Luca Frosini 2022-04-11 16:14:33 +02:00
parent 1ccec24890
commit e198f1a089
1 changed files with 6 additions and 2 deletions

View File

@ -1345,8 +1345,10 @@ public class CKANPackage extends CKAN implements Moderated {
// Need to use sysadmin because the user could not have the right to modify the item // Need to use sysadmin because the user could not have the right to modify the item
setApiKey(CKANUtility.getSysAdminAPI()); setApiKey(CKANUtility.getSysAdminAPI());
String ret = sendPostRequest(ITEM_UPDATE, getAsString(result)); String ret = sendPostRequest(ITEM_UPDATE, getAsString(result));
// Resetting the api key
setApiKey(null);
result = mapper.readTree(ret); result = mapper.readTree(ret);
parseResult(); parseResult();
@ -1396,8 +1398,10 @@ public class CKANPackage extends CKAN implements Moderated {
// Need to use sysadmin because the user could not have the right to modify the item // Need to use sysadmin because the user could not have the right to modify the item
setApiKey(CKANUtility.getSysAdminAPI()); setApiKey(CKANUtility.getSysAdminAPI());
String ret = sendPostRequest(ITEM_PATCH, getAsString(result)); String ret = sendPostRequest(ITEM_PATCH, getAsString(result));
// Resetting the api key
setApiKey(null);
result = mapper.readTree(ret); result = mapper.readTree(ret);
parseResult(); parseResult();
moderationThread.setItemCoordinates(itemID, name, itemTitle, itemURL); moderationThread.setItemCoordinates(itemID, name, itemTitle, itemURL);