[FIX] gamification: initialize goals at 0
If a manual goal has a target of 10, it should not start at 9 but 0 If it has a target of 0, it should start at -1 Task id: 2057898
This commit is contained in:
@@ -383,9 +383,9 @@ class Challenge(models.Model):
|
||||
|
||||
# the goal is initialised over the limit to make sure we will compute it at least once
|
||||
if line.condition == 'higher':
|
||||
values['current'] = line.target_goal - 1
|
||||
values['current'] = min(line.target_goal - 1, 0)
|
||||
else:
|
||||
values['current'] = line.target_goal + 1
|
||||
values['current'] = max(line.target_goal + 1, 0)
|
||||
|
||||
if challenge.remind_update_delay:
|
||||
values['remind_update_delay'] = challenge.remind_update_delay
|
||||
|
||||
Reference in New Issue
Block a user