dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42304
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21627: System setting controller, POST, removed key param
------------------------------------------------------------
revno: 21627
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2016-01-06 18:08:06 +0100
message:
System setting controller, POST, removed key param
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemSettingController.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemSettingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemSettingController.java 2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemSettingController.java 2016-01-06 17:08:06 +0000
@@ -77,12 +77,11 @@
@PreAuthorize( "hasRole('ALL') or hasRole('F_SYSTEM_SETTING')" )
public void setSystemSetting(
@PathVariable( value = "key" ) String key,
- @RequestParam( required = false, value = "key" ) String keyParam,
- @RequestParam( required = false ) String value,
+ @RequestParam( value = "value", required = false ) String value,
@RequestBody( required = false ) String valuePayload,
HttpServletResponse response, HttpServletRequest request ) throws WebMessageException
{
- if ( key == null && keyParam == null )
+ if ( key == null )
{
throw new WebMessageException( WebMessageUtils.conflict( "Key must be specified" ) );
}
@@ -92,8 +91,6 @@
throw new WebMessageException( WebMessageUtils.conflict( "Value must be specified as query param or as payload" ) );
}
- key = ObjectUtils.firstNonNull( key, keyParam );
-
value = ObjectUtils.firstNonNull( value, valuePayload );
Serializable valueObject = SettingKey.getAsRealClass( key, value );