Fixed bug in fuel_create
This commit is contained in:
parent
bb9f13a031
commit
7fdc0e407f
@ -705,12 +705,17 @@ def fuel_create(request):
|
||||
form = FuelEntryForm(request.POST, user=request.user)
|
||||
|
||||
if form.is_valid():
|
||||
category, _ = Category.objects.get_or_create(
|
||||
slug="gasolina",
|
||||
owner=request.user,
|
||||
defaults={"Name": "Gasolina"},
|
||||
)
|
||||
expense = Expense.objects.create(
|
||||
owner=request.user,
|
||||
date=form.cleaned_data["date"],
|
||||
amount=form.cleaned_data["amount"],
|
||||
account=form.cleaned_data["account"],
|
||||
category=Category.objects.get(slug="gasolina"),
|
||||
category=category,
|
||||
description="Repostaje",
|
||||
)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user