[virtualcommons-developer] commit/vcweb: alllee: fixing bug in set_harvest_decision, including roun
Status: Beta
Brought to you by:
alllee
|
From: <com...@bi...> - 2013-03-22 22:06:13
|
1 new commit in vcweb: https://bitbucket.org/virtualcommons/vcweb/commits/df784a63c10d/ Changeset: df784a63c10d User: alllee Date: 2013-03-22 23:06:09 Summary: fixing bug in set_harvest_decision, including round_data Affected #: 1 file diff -r 26a1a25514a4daaa9ac84b1ed65084b9cb323f66 -r df784a63c10db920b457e5254b1a26b991b29ed0 vcweb/forestry/models.py --- a/vcweb/forestry/models.py +++ b/vcweb/forestry/models.py @@ -103,8 +103,15 @@ def get_initial_resource_level_parameter(): return Parameter.objects.for_round(name='initial_resource_level') -def set_harvest_decision(participant_group_relationship=None, value=None): - participant_group_relationship.set_data_value(parameter=get_harvest_decision_parameter(), value=value) +def set_harvest_decision(participant_group_relationship=None, value=None, round_data=None): + if round_data is None: + round_data = participant_group_relationship.current_round_data + prdv = ParticipantRoundDataValue.objects.get(parameter=get_harvest_decision_parameter(), + participant_group_relationship=participant_group_relationship, + round_data=round_data + ) + prdv.int_value = value + prdv.save() def set_resource_level(group, value, round_data=None): return group.set_data_value(parameter=get_resource_level_parameter(), round_data=round_data, value=value) Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |