Fix bug editing budgets
This commit is contained in:
parent
cdb3518b28
commit
f46f966bbb
@ -257,11 +257,12 @@ def budget_edit(request, budget, revision):
|
||||
return redirect(reverse('budget_list'))
|
||||
|
||||
with transaction.atomic():
|
||||
revision = models.BudgetRevision()
|
||||
revision.author = request.user
|
||||
revision.time = timezone.now()
|
||||
revision.action = models.BudgetAction.EDIT.value
|
||||
revision = revision_from_form(budget, revision, request.POST)
|
||||
new_revision = models.BudgetRevision()
|
||||
new_revision.author = request.user
|
||||
new_revision.time = timezone.now()
|
||||
new_revision.action = models.BudgetAction.EDIT.value
|
||||
new_revision.state = revision.state
|
||||
new_revision = revision_from_form(budget, new_revision, request.POST)
|
||||
|
||||
if request.POST['submit'] == 'Save':
|
||||
return redirect(reverse('budget_view', kwargs={'id': budget.id}))
|
||||
|
Loading…
Reference in New Issue
Block a user