202 Geometry conflict checking to background

* wraps check_for_conflicts() in celery based method
* fixes bug on InterventionEditForm where geometry's save() has been called twice
This commit is contained in:
2022-09-15 12:12:35 +02:00
parent 4b20802a6a
commit 2957a6aa60
4 changed files with 10 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ from django.utils import timezone
from konova.models import BaseResource, UuidModel
from konova.sub_settings.lanis_settings import DEFAULT_SRID_RLP
from konova.tasks import celery_check_for_geometry_conflicts
from konova.utils.wfs.spatial import ParcelWFSFetcher
@@ -28,7 +29,7 @@ class Geometry(BaseResource):
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
self.check_for_conflicts()
celery_check_for_geometry_conflicts.delay(self.id)
def check_for_conflicts(self):
""" Checks for new geometry overlaps