Skip to content
Snippets Groups Projects
Commit 23b65dba authored by Simon Künzel's avatar Simon Künzel
Browse files

Add cause user id to field change events

parent 098b813e
Branches
Tags
No related merge requests found
Pipeline #7544 passed
Pipeline: backend

#7545

    ...@@ -449,7 +449,8 @@ class ApiObjectClass: ...@@ -449,7 +449,8 @@ class ApiObjectClass:
    "field_id": field_id, "field_id": field_id,
    "old_value": old_value_json, "old_value": old_value_json,
    "new_value": new_value_json, "new_value": new_value_json,
    } },
    cause_user_id=modifying_user_id
    )) ))
    for child_class_id, child_ids in children_ids_by_child_class_id.items(): for child_class_id, child_ids in children_ids_by_child_class_id.items():
    for child_id in child_ids: for child_id in child_ids:
    ...@@ -462,7 +463,8 @@ class ApiObjectClass: ...@@ -462,7 +463,8 @@ class ApiObjectClass:
    "field_id": field_id, "field_id": field_id,
    "old_value": old_value_json, "old_value": old_value_json,
    "new_value": new_value_json, "new_value": new_value_json,
    } },
    cause_user_id=modifying_user_id
    )) ))
    expected_keys.discard(field_id) expected_keys.discard(field_id)
    ......
    ...@@ -114,14 +114,15 @@ class Job(ApiObject, Base): ...@@ -114,14 +114,15 @@ class Job(ApiObject, Base):
    ) )
    @staticmethod @staticmethod
    def create_event(event_type: str, event_data: JsonTypes, cause_job_id: int or None = None): def create_event(event_type: str, event_data: JsonTypes, cause_job_id: int or None = None, cause_user_id: int or None = None):
    return Job( return Job(
    type="handle_event", type="handle_event",
    input_data={ input_data={
    "type": event_type, "type": event_type,
    "data": event_data "data": event_data
    }, },
    cause_job_id=cause_job_id cause_job_id=cause_job_id,
    cause_user_id=cause_user_id,
    ) )
    def set_error(self, error_code: str, error_message: str or None = None): def set_error(self, error_code: str, error_message: str or None = None):
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment