← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17693: set proper http status when adding to a collection, and item already exists

 

------------------------------------------------------------
revno: 17693
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-12-11 15:10:11 +0100
message:
  set proper http status when adding to a collection, and item already exists
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.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/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-12-08 15:40:55 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-12-11 14:10:11 +0000
@@ -573,6 +573,7 @@
         // if it already contains this object, don't add it. It might be a list and not set, and we don't want duplicates.
         if ( identifiableObjects.contains( candidate ) )
         {
+            response.setStatus( HttpServletResponse.SC_NO_CONTENT );
             return; // nothing to do, just return with OK
         }