Commit 532075b9 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Fix vulnerability statistics calculation

`SystemNoteService.change_vulnerability_state` has a side effect on the
vulnerability object which is changing the `previous_changes` and
breaking the statistics calculation logic. Therefore we have to execute
the statistics logic before the `SystemNoteService`.
parent 8b856d04
......@@ -15,9 +15,9 @@ module Vulnerabilities
def update_with_note(vulnerability, params)
return false unless vulnerability.update(params)
SystemNoteService.change_vulnerability_state(vulnerability, @user) if vulnerability.state_previously_changed?
Vulnerabilities::Statistics::UpdateService.update_for(vulnerability)
Vulnerabilities::HistoricalStatistics::UpdateService.update_for(vulnerability.project)
SystemNoteService.change_vulnerability_state(vulnerability, @user) if vulnerability.state_previously_changed?
true
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment