From 2ff5050750ba2e0bf474dbf0808e6a9cb6b57ecb Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Thu, 29 Aug 2024 16:43:29 +0200 Subject: [PATCH] =?UTF-8?q?Nueva=20versi=C3=B3n=20y=20correcciones=20sint?= =?UTF-8?q?=C3=A1cticas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RepostajesDj/K8S/Makefile | 2 +- RepostajesDj/vehiculos/repostajes/forms.py | 1 + RepostajesDj/vehiculos/repostajes/views.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RepostajesDj/K8S/Makefile b/RepostajesDj/K8S/Makefile index 5de63d3..726958b 100644 --- a/RepostajesDj/K8S/Makefile +++ b/RepostajesDj/K8S/Makefile @@ -1,7 +1,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') #export REGISTRY=registry.cube.local export REGISTRY=registry.reymota.es -export IMG_VERSION = 1.3 +export IMG_VERSION = 1.4 export IMG_NGINX_VERSION = 1.0 # limpia todo diff --git a/RepostajesDj/vehiculos/repostajes/forms.py b/RepostajesDj/vehiculos/repostajes/forms.py index 814c694..86db0e0 100644 --- a/RepostajesDj/vehiculos/repostajes/forms.py +++ b/RepostajesDj/vehiculos/repostajes/forms.py @@ -3,6 +3,7 @@ from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import Vehiculo, Repostaje, ReyMotaUser + class VehiculoForm(forms.ModelForm): class Meta: model = Vehiculo diff --git a/RepostajesDj/vehiculos/repostajes/views.py b/RepostajesDj/vehiculos/repostajes/views.py index 690ce2d..b70e140 100644 --- a/RepostajesDj/vehiculos/repostajes/views.py +++ b/RepostajesDj/vehiculos/repostajes/views.py @@ -97,7 +97,7 @@ def nuevo_repostaje(request): instancia.importe = float(instancia.importe) - instancia.descuento if instancia.litros > 0: - instancia.precioxlitro = round(instancia.importe / float(instancia.litros),2) + instancia.precioxlitro = round(instancia.importe / float(instancia.litros), 2) else: instancia.precioxlitro = 0 @@ -110,7 +110,7 @@ def nuevo_repostaje(request): instancia.kmsrecorridos = instancia.kms - repostajes.kms if instancia.kmsrecorridos > 0: - instancia.consumo = round(instancia.litros * 100 / instancia.kmsrecorridos,2) + instancia.consumo = round(instancia.litros * 100 / instancia.kmsrecorridos, 2) else: instancia.kmsrecorridos = 0 instancia.consumo = 0