API Celery parcel calculation fix

* fixes bug where API stored data would not have parcels be calculated correctly
This commit is contained in:
2022-09-28 12:24:06 +02:00
parent 66a2387791
commit 0e9f0ba53e
4 changed files with 27 additions and 27 deletions

View File

@@ -161,12 +161,12 @@ class InterventionAPISerializerV1(AbstractModelAPISerializerV1,
obj.legal.save()
obj.save()
obj.users.add(user)
obj.log.add(obj.created)
obj.users.add(user)
obj.log.add(obj.created)
celery_update_parcels.delay(obj.geometry.id)
celery_update_parcels.delay(obj.geometry.id)
return obj.id
return obj.id
def update_model_from_json(self, id, json_model, user):
""" Updates an entry for the model based on the contents of json_model
@@ -198,8 +198,8 @@ class InterventionAPISerializerV1(AbstractModelAPISerializerV1,
obj.legal.save()
obj.save()
obj.mark_as_edited(user, edit_comment="API update")
obj.mark_as_edited(user, edit_comment="API update")
celery_update_parcels.delay(obj.geometry.id)
celery_update_parcels.delay(obj.geometry.id)
return obj.id
return obj.id