dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25078
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12361: support dryRun user import
------------------------------------------------------------
revno: 12361
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-01 14:07:27 +0200
message:
support dryRun user import
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.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/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2013-10-01 11:56:18 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2013-10-01 12:07:27 +0000
@@ -412,7 +412,6 @@
UserCredentials userCredentials = null;
- /*
if ( object instanceof User )
{
userCredentials = ((User) object).getUserCredentials();
@@ -425,7 +424,6 @@
return false;
}
}
- */
Map<Field, Object> fields = detachFields( object );
Map<Field, Collection<Object>> collectionFields = detachCollectionFields( object );
@@ -440,8 +438,7 @@
objectBridge.updateObject( object );
- /*
- if ( object instanceof User )
+ if ( object instanceof User && !options.isDryRun() )
{
userCredentials.setUser( (User) object );
userCredentials.setId( object.getId() );
@@ -458,7 +455,6 @@
objectBridge.updateObject( object );
}
- */
if ( !options.isDryRun() )
{
@@ -530,7 +526,7 @@
objectBridge.updateObject( persistedObject );
- if ( object instanceof User )
+ if ( object instanceof User && !options.isDryRun() )
{
Map<Field, Collection<Object>> collectionFieldsUserCredentials = detachCollectionFields( userCredentials );