← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22074: minor fixes

 

------------------------------------------------------------
revno: 22074
committer: Morten Olav Hansen <morten@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-02-29 14:46:20 +0700
message:
  minor fixes
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/hooks/IdentifiableObjectBundleHook.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/hooks/IdentifiableObjectBundleHook.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/hooks/IdentifiableObjectBundleHook.java	2016-02-29 07:35:27 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/hooks/IdentifiableObjectBundleHook.java	2016-02-29 07:46:20 +0000
@@ -60,7 +60,7 @@
         for ( AttributeValue attributeValue : identifiableObject.getAttributeValues() )
         {
             Attribute attribute = bundle.getPreheat().get( bundle.getPreheatIdentifier(), attributeValue.getAttribute() );
-            if ( attribute != null ) attributeValue.setAttribute( attribute );
+            attributeValue.setAttribute( attribute );
             sessionFactory.getCurrentSession().save( attributeValue );
         }
     }
@@ -68,12 +68,11 @@
     public void handleUserGroupAccessesCreate( IdentifiableObject identifiableObject, ObjectBundle bundle, Schema schema )
     {
         if ( !schema.havePersistedProperty( "userGroupAccesses" ) ) return;
-        identifiableObject.getUserGroupAccesses().clear();
 
         for ( UserGroupAccess userGroupAccess : identifiableObject.getUserGroupAccesses() )
         {
             UserGroup userGroup = bundle.getPreheat().get( bundle.getPreheatIdentifier(), userGroupAccess.getUserGroup() );
-            if ( userGroup != null ) userGroupAccess.setUserGroup( userGroup );
+            userGroupAccess.setUserGroup( userGroup );
             sessionFactory.getCurrentSession().save( userGroupAccess );
         }
     }