diff --git a/licenseware/history/step.py b/licenseware/history/step.py index 94b5d14a..a84fe758 100644 --- a/licenseware/history/step.py +++ b/licenseware/history/step.py @@ -48,13 +48,21 @@ def copy_files_uploaded_on_event_folder(data): def save_file_content_validation(metadata, response): + file_content_validation = [] + for cv in response["event_data"]: + file_content_validation.extend(cv["validation_response"]['validation']) + + filepaths = [] + for cv in response["event_data"]: + filepaths.extend(cv["filepaths"]) + data = { "tenant_id": metadata["tenant_id"], "event_id": metadata["event_id"], "app_id": metadata["app_id"], "uploader_id": metadata["uploader_id"], - "file_content_validation": response["event_data"]["validation_response"]["validation"], - "files_uploaded": response["event_data"]["filepaths"], + "file_content_validation": file_content_validation, + "files_uploaded": filepaths, "updated_at": datetime.datetime.utcnow().isoformat() } diff --git a/licenseware/uploader_builder/uploader_builder.py b/licenseware/uploader_builder/uploader_builder.py index 9c63912c..96e37c22 100644 --- a/licenseware/uploader_builder/uploader_builder.py +++ b/licenseware/uploader_builder/uploader_builder.py @@ -188,10 +188,10 @@ def upload_files(self, flask_request: Request, event_id: str = None): } for filepath in valid_filepaths ] - events_data = [ + [ self.worker.send(event) for event in events if validate_event(event, raise_error=False) ] - return {'status': states.SUCCESS, 'message': 'Event sent', 'event_data': events_data}, 200 + return {'status': states.SUCCESS, 'message': 'Event sent', 'event_data': events}, 200 else: event.update({ 'filepaths': valid_filepaths, @@ -207,7 +207,7 @@ def upload_files(self, flask_request: Request, event_id: str = None): log.info("Sending event: " + str(event)) self.worker.send(event) - return {'status': states.SUCCESS, 'message': 'Event sent', 'event_data': event}, 200 + return {'status': states.SUCCESS, 'message': 'Event sent', 'event_data': [event]}, 200 def init_tenant_quota(self, tenant_id: str, auth_token: str): diff --git a/wheel_sdk/licenseware-2.0.2-py3-none-any.whl b/wheel_sdk/licenseware-2.0.2-py3-none-any.whl index 4ee31caf..a4cc5446 100644 Binary files a/wheel_sdk/licenseware-2.0.2-py3-none-any.whl and b/wheel_sdk/licenseware-2.0.2-py3-none-any.whl differ diff --git a/wheel_sdk/licenseware-2.0.2.tar.gz b/wheel_sdk/licenseware-2.0.2.tar.gz index 278c5ab5..44efe295 100644 Binary files a/wheel_sdk/licenseware-2.0.2.tar.gz and b/wheel_sdk/licenseware-2.0.2.tar.gz differ