← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14783: Minor

 

------------------------------------------------------------
revno: 14783
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-11 01:15:56 +0200
message:
  Minor
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.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-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java	2014-04-08 19:36:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java	2014-04-10 23:15:56 +0000
@@ -299,14 +299,17 @@
         userService.updateUser( user );
 
         // ---------------------------------------------------------------------
-        // Organisation unit trees
+        // Update organisation unit trees if current user is being updated
         // ---------------------------------------------------------------------
 
-        if ( user.equals( currentUserService.getCurrentUser() ) )
+        if ( user.equals( currentUserService.getCurrentUser() ) && !dataCaptureOrgUnits.isEmpty() )
         {
             selectionManager.setRootOrganisationUnits( dataCaptureOrgUnits );
             selectionManager.setSelectedOrganisationUnits( dataCaptureOrgUnits );
-
+        }
+        
+        if ( user.equals( currentUserService.getCurrentUser() ) && !dataViewOrgUnits.isEmpty() )
+        {
             selectionTreeManager.setRootOrganisationUnits( dataViewOrgUnits );
             selectionTreeManager.setSelectedOrganisationUnits( dataViewOrgUnits );
         }