diff --git a/strr-api/pyproject.toml b/strr-api/pyproject.toml index 180b4306..4b6e48b0 100644 --- a/strr-api/pyproject.toml +++ b/strr-api/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "strr-api" -version = "0.0.31" +version = "0.0.32" description = "" authors = ["thorwolpert "] license = "BSD 3-Clause" diff --git a/strr-api/src/strr_api/responses/RegistrationSerializer.py b/strr-api/src/strr_api/responses/RegistrationSerializer.py index 23b8eaa5..8042d02b 100644 --- a/strr-api/src/strr_api/responses/RegistrationSerializer.py +++ b/strr-api/src/strr_api/responses/RegistrationSerializer.py @@ -24,6 +24,19 @@ def serialize(cls, registration: Registration): "registration_number": registration.registration_number, } + documents = [] + if registration.documents: + for doc in registration.documents: + documents.append( + { + "fileKey": doc.path, + "fileName": doc.file_name, + "fileType": doc.file_type, + "documentType": doc.document_type, + } + ) + registration_data["documents"] = documents + if registration.registration_type == RegistrationType.HOST.value: RegistrationSerializer.populate_host_registration_details(registration_data, registration) @@ -169,18 +182,6 @@ def populate_platform_registration_details(cls, registration_data: dict, registr @classmethod def populate_host_registration_details(cls, registration_data: dict, registration: Registration): """Populates host registration details into response object.""" - documents = [] - if registration.documents: - for doc in registration.documents: - documents.append( - { - "fileKey": doc.path, - "fileName": doc.file_name, - "fileType": doc.file_type, - "documentType": doc.document_type, - } - ) - registration_data["documents"] = documents primary_property_contact = list(filter(lambda x: x.is_primary is True, registration.rental_property.contacts))[ 0