=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/mapping/MapController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/mapping/MapController.java 2012-10-31 14:33:22 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/mapping/MapController.java 2012-11-03 14:18:46 +0000 @@ -46,7 +46,7 @@ import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.period.PeriodService; -import org.hisp.dhis.user.UserService; +import org.hisp.dhis.user.CurrentUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; @@ -77,9 +77,6 @@ private OrganisationUnitGroupService organisationUnitGroupService; @Autowired - private UserService userService; - - @Autowired private IndicatorService indicatorService; @Autowired @@ -88,6 +85,9 @@ @Autowired private PeriodService periodService; + @Autowired + private CurrentUserService currentUserService; + //-------------------------------------------------------------------------- // CRUD //-------------------------------------------------------------------------- @@ -147,6 +147,11 @@ map.mergeWith( newMap ); + if ( newMap.getUser() == null ) + { + map.setUser( null ); + } + mappingService.updateMap( map ); } @@ -199,7 +204,7 @@ { if ( map.getUser() != null ) { - map.setUser( userService.getUser( map.getUser().getUid() ) ); + map.setUser( currentUserService.getCurrentUser() ); } }