JS Tree enhancement

* extends compensation state forms to match the new logic
* adds minor changes for tests
This commit is contained in:
2022-05-11 10:16:34 +02:00
parent a334fff54d
commit 71afdd8b36
2 changed files with 20 additions and 4 deletions

View File

@@ -8,6 +8,8 @@ Created on: 16.11.21
import shutil
from django.contrib import messages
from codelist.models import KonovaCode
from user.models import User, Team
from django.db import models, transaction
from django.db.models import QuerySet, Sum
@@ -142,8 +144,10 @@ class AbstractCompensation(BaseObject, GeoReferencedMixin):
"""
form_data = form.cleaned_data
with transaction.atomic():
biotope_type_id = form_data["biotope_type"]
code = KonovaCode.objects.get(id=biotope_type_id)
state = CompensationState.objects.create(
biotope_type=form_data["biotope_type"],
biotope_type=code,
surface=form_data["surface"],
)
state_additional_types = form_data["biotope_extra"]