API Celery parcel calculation fix
* fixes bug where API stored data would not have parcels be calculated correctly
This commit is contained in:
parent
66a2387791
commit
0e9f0ba53e
@ -125,11 +125,11 @@ class CompensationAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensa
|
|||||||
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
||||||
obj = self._set_deadlines(obj, properties["deadlines"])
|
obj = self._set_deadlines(obj, properties["deadlines"])
|
||||||
|
|
||||||
obj.log.add(obj.created)
|
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):
|
def update_model_from_json(self, id, json_model, user):
|
||||||
""" Updates an entry for the model based on the contents of json_model
|
""" Updates an entry for the model based on the contents of json_model
|
||||||
@ -165,8 +165,8 @@ class CompensationAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensa
|
|||||||
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
||||||
obj = self._set_deadlines(obj, properties["deadlines"])
|
obj = self._set_deadlines(obj, properties["deadlines"])
|
||||||
|
|
||||||
obj.log.add(update_action)
|
obj.log.add(update_action)
|
||||||
|
|
||||||
celery_update_parcels.delay(obj.geometry.id)
|
celery_update_parcels.delay(obj.geometry.id)
|
||||||
|
|
||||||
return obj.id
|
return obj.id
|
||||||
|
@ -146,12 +146,12 @@ class EcoAccountAPISerializerV1(AbstractModelAPISerializerV1,
|
|||||||
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
||||||
obj = self._set_deadlines(obj, properties["deadlines"])
|
obj = self._set_deadlines(obj, properties["deadlines"])
|
||||||
|
|
||||||
obj.log.add(obj.created)
|
obj.log.add(obj.created)
|
||||||
obj.users.add(user)
|
obj.users.add(user)
|
||||||
|
|
||||||
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):
|
def update_model_from_json(self, id, json_model, user):
|
||||||
""" Updates an entry for the model based on the contents of json_model
|
""" Updates an entry for the model based on the contents of json_model
|
||||||
@ -190,8 +190,8 @@ class EcoAccountAPISerializerV1(AbstractModelAPISerializerV1,
|
|||||||
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
||||||
obj = self._set_deadlines(obj, properties["deadlines"])
|
obj = self._set_deadlines(obj, properties["deadlines"])
|
||||||
|
|
||||||
obj.log.add(update_action)
|
obj.log.add(update_action)
|
||||||
|
|
||||||
celery_update_parcels.delay(obj.geometry.id)
|
celery_update_parcels.delay(obj.geometry.id)
|
||||||
|
|
||||||
return obj.id
|
return obj.id
|
||||||
|
@ -118,12 +118,12 @@ class EmaAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensationAPISe
|
|||||||
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
||||||
obj = self._set_deadlines(obj, properties["deadlines"])
|
obj = self._set_deadlines(obj, properties["deadlines"])
|
||||||
|
|
||||||
obj.log.add(obj.created)
|
obj.log.add(obj.created)
|
||||||
obj.users.add(user)
|
obj.users.add(user)
|
||||||
|
|
||||||
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):
|
def update_model_from_json(self, id, json_model, user):
|
||||||
""" Updates an entry for the model based on the contents of json_model
|
""" Updates an entry for the model based on the contents of json_model
|
||||||
@ -159,8 +159,8 @@ class EmaAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensationAPISe
|
|||||||
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
obj = self._set_compensation_states(obj, properties["after_states"], obj.after_states)
|
||||||
obj = self._set_deadlines(obj, properties["deadlines"])
|
obj = self._set_deadlines(obj, properties["deadlines"])
|
||||||
|
|
||||||
obj.log.add(update_action)
|
obj.log.add(update_action)
|
||||||
|
|
||||||
celery_update_parcels.delay(obj.geometry.id)
|
celery_update_parcels.delay(obj.geometry.id)
|
||||||
|
|
||||||
return obj.id
|
return obj.id
|
||||||
|
@ -161,12 +161,12 @@ class InterventionAPISerializerV1(AbstractModelAPISerializerV1,
|
|||||||
obj.legal.save()
|
obj.legal.save()
|
||||||
obj.save()
|
obj.save()
|
||||||
|
|
||||||
obj.users.add(user)
|
obj.users.add(user)
|
||||||
obj.log.add(obj.created)
|
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):
|
def update_model_from_json(self, id, json_model, user):
|
||||||
""" Updates an entry for the model based on the contents of json_model
|
""" Updates an entry for the model based on the contents of json_model
|
||||||
@ -198,8 +198,8 @@ class InterventionAPISerializerV1(AbstractModelAPISerializerV1,
|
|||||||
obj.legal.save()
|
obj.legal.save()
|
||||||
obj.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
|
||||||
|
Loading…
Reference in New Issue
Block a user