egon_sending_on_edit #263
@ -133,7 +133,6 @@ class InterventionAPISerializerV1(AbstractModelAPISerializerV1,
|
||||
id__in=payments
|
||||
)
|
||||
obj.payments.set(payments)
|
||||
obj.send_data_to_egon()
|
||||
return obj
|
||||
|
||||
def create_model_from_json(self, json_model, user):
|
||||
@ -201,6 +200,7 @@ class InterventionAPISerializerV1(AbstractModelAPISerializerV1,
|
||||
obj.save()
|
||||
|
||||
obj.mark_as_edited(user, edit_comment="API update")
|
||||
obj.send_data_to_egon()
|
||||
|
||||
celery_update_parcels.delay(obj.geometry.id)
|
||||
|
||||
|
@ -385,6 +385,7 @@ class EditInterventionForm(NewInterventionForm):
|
||||
geometry = geom_form.save(user_action)
|
||||
self.instance.geometry = geometry
|
||||
self.instance.save()
|
||||
self.instance.send_data_to_egon()
|
||||
|
||||
return self.instance
|
||||
|
||||
|
@ -25,8 +25,6 @@ class NewInterventionDocumentModalForm(NewDocumentModalForm):
|
||||
|
||||
"""
|
||||
doc = super().save(*args, **kwargs)
|
||||
|
||||
if self.instance.payments.exists():
|
||||
self.instance.send_data_to_egon()
|
||||
|
||||
return doc
|
||||
|
@ -145,11 +145,13 @@ class Intervention(BaseObject,
|
||||
Returns:
|
||||
|
||||
"""
|
||||
if self.payments.exists():
|
||||
celery_export_to_egon.delay(self.id)
|
||||
|
||||
def set_recorded(self, user: User) -> UserActionLogEntry:
|
||||
log_entry = super().set_recorded(user)
|
||||
self.add_log_entry_to_compensations(log_entry)
|
||||
self.send_data_to_egon()
|
||||
return log_entry
|
||||
|
||||
def add_log_entry_to_compensations(self, log_entry: UserActionLogEntry):
|
||||
|
Loading…
Reference in New Issue
Block a user