Actually preserve claim state when editing

This commit is contained in:
Yingtong Li 2020-02-12 23:32:49 +11:00
parent f091b20773
commit dbe1eb988c
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -171,7 +171,6 @@ def claim_from_form(claim, form, files):
claim.budget_id = form['budget_id']
claim.comments = form['comments']
claim.state = models.ClaimState.DRAFT.value
claim.items = json.loads(form['items'])
claim.payee_name = form['payee_name']
@ -554,9 +553,7 @@ def claim_edit(request, claim):
return redirect(reverse('claim_list'))
with transaction.atomic():
state = claim.state
claim = claim_from_form(claim, request.POST, request.FILES)
claim.state = state
claim_history = models.ClaimHistory()
claim_history.claim = claim