Actually preserve claim state when editing
This commit is contained in:
parent
f091b20773
commit
dbe1eb988c
@ -171,7 +171,6 @@ def claim_from_form(claim, form, files):
|
|||||||
claim.budget_id = form['budget_id']
|
claim.budget_id = form['budget_id']
|
||||||
|
|
||||||
claim.comments = form['comments']
|
claim.comments = form['comments']
|
||||||
claim.state = models.ClaimState.DRAFT.value
|
|
||||||
claim.items = json.loads(form['items'])
|
claim.items = json.loads(form['items'])
|
||||||
|
|
||||||
claim.payee_name = form['payee_name']
|
claim.payee_name = form['payee_name']
|
||||||
@ -554,9 +553,7 @@ def claim_edit(request, claim):
|
|||||||
return redirect(reverse('claim_list'))
|
return redirect(reverse('claim_list'))
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
state = claim.state
|
|
||||||
claim = claim_from_form(claim, request.POST, request.FILES)
|
claim = claim_from_form(claim, request.POST, request.FILES)
|
||||||
claim.state = state
|
|
||||||
|
|
||||||
claim_history = models.ClaimHistory()
|
claim_history = models.ClaimHistory()
|
||||||
claim_history.claim = claim
|
claim_history.claim = claim
|
||||||
|
Loading…
Reference in New Issue
Block a user