← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16435: Org unit controller, fixed param bug

 

------------------------------------------------------------
revno: 16435
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-08-18 12:44:11 +0200
message:
  Org unit controller, fixed param bug
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.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/organisationunit/OrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java	2014-08-15 18:48:11 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java	2014-08-18 10:44:11 +0000
@@ -75,16 +75,12 @@
     {
         List<OrganisationUnit> entityList;
 
-        Integer level = null;
-
+        Integer level = options.getInt( "level" );
+        Integer maxLevel = options.getInt( "maxLevel" );        
         boolean levelSorted = options.isTrue( "levelSorted" );
 
-        Integer maxLevel = options.getInt( "level" );
-
-        if ( options.contains( "maxLevel" ) )
+        if ( maxLevel != null )
         {
-            maxLevel = options.getInt( "maxLevel" );
-
             if ( organisationUnitService.getOrganisationUnitLevelByLevel( maxLevel ) == null )
             {
                 maxLevel = null;