From 23544cbafff128d03fdcb5d70e279202e022ecf3 Mon Sep 17 00:00:00 2001 From: Patrick Mayr Date: Fri, 7 Feb 2025 13:28:49 +0100 Subject: [PATCH] fix type --- fet2020/finance/forms.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fet2020/finance/forms.py b/fet2020/finance/forms.py index 209a653a..6e7aa35c 100644 --- a/fet2020/finance/forms.py +++ b/fet2020/finance/forms.py @@ -1,5 +1,6 @@ from datetime import datetime from dateutil.relativedelta import relativedelta +import decimal from django import forms from django.core.validators import ValidationError @@ -638,9 +639,9 @@ class ResolutionAdminForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # to get the self.fields set - budget = 0.0 - total = 0.0 - if (resolution := kwargs.get("instance")) is not None: + budget = decimal.Decimal(0.0) + total = decimal.Decimal(0.0) + if resolution := kwargs.get("instance"): for elem in Bill.objects.filter(resolution=resolution): total += elem.amount