19_Tests #40

Merged
mpeltriaux merged 19 commits from 19_Tests into master 2021-11-15 09:48:12 +01:00
3 changed files with 5 additions and 6 deletions
Showing only changes of commit 107cbeadee - Show all commits

View File

@ -35,7 +35,9 @@ class CompensationManager(models.Manager):
""" """
def get_queryset(self): def get_queryset(self):
return super().get_queryset().select_related( return super().get_queryset().filter(
deleted__isnull=True,
).select_related(
"modified", "modified",
"intervention", "intervention",
"intervention__recorded", "intervention__recorded",

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

@ -345,9 +345,9 @@ class NewDeductionModalForm(BaseModalForm):
return False return False
# Calculate valid surface # Calculate valid surface
sum_surface = acc.get_surface_after_states() deductable_surface = acc.deductable_surface
sum_surface_deductions = acc.get_deductions_surface() sum_surface_deductions = acc.get_deductions_surface()
rest_surface = sum_surface - sum_surface_deductions rest_surface = deductable_surface - sum_surface_deductions
form_surface = float(self.cleaned_data["surface"]) form_surface = float(self.cleaned_data["surface"])
is_valid_surface = form_surface < rest_surface is_valid_surface = form_surface < rest_surface
if not is_valid_surface: if not is_valid_surface: