JS Tree enhancement
* extends compensation state forms to match the new logic * adds minor changes for tests
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user