dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16745
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6442: Minor fix
------------------------------------------------------------
revno: 6442
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-03-30 00:07:52 +0200
message:
Minor fix
modified:
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.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-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2012-03-29 16:45:18 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2012-03-29 22:07:52 +0000
@@ -149,6 +149,11 @@
categoryOptionCombo = fallbackCategoryOptionCombo;
}
+ if ( dataValue.getValue() == null && dataValue.getComment() == null )
+ {
+ continue;
+ }
+
internalValue.setDataElement( dataElement );
internalValue.setPeriod( periodService.reloadPeriod( period ) );
internalValue.setSource( orgUnit );
@@ -206,23 +211,23 @@
throw new IllegalArgumentException( "Period must be provided on data value set in order to complete data set" );
}
- CompleteDataSetRegistration complete = registrationService.getCompleteDataSetRegistration( dataSet, period, orgUnit );
+ CompleteDataSetRegistration completeAlready = registrationService.getCompleteDataSetRegistration( dataSet, period, orgUnit );
String username = currentUserService.getCurrentUsername();
- if ( completeDate == null && complete != null )
+ if ( completeDate == null && completeAlready != null )
{
- throw new IllegalArgumentException( "Data value set is complete - include a new complete date if you want to update it" );
+ throw new IllegalArgumentException( "Data value set is complete - a new complete date must be provided" );
}
if ( completeDate != null )
{
- if ( complete != null )
+ if ( completeAlready != null )
{
- complete.setStoredBy( username );
- complete.setDate( completeDate );
+ completeAlready.setStoredBy( username );
+ completeAlready.setDate( completeDate );
- registrationService.updateCompleteDataSetRegistration( complete );
+ registrationService.updateCompleteDataSetRegistration( completeAlready );
}
else
{