Other files persisted to DB with file_type OTHER 🟩

This commit is contained in:
Daniel Roth 2026-06-02 09:41:39 +00:00
parent af61c362b2
commit fa450a37a3

View file

@ -104,7 +104,11 @@ class PashubService:
if downloaded.other:
self._upload_to_s3_and_update_db(
downloaded.other, uprn, hubspot_deal_id, file_source
downloaded.other,
uprn,
hubspot_deal_id,
file_source,
default_file_type=FileTypeEnum.OTHER.value,
)
# SharePoint upload disabled: pashub sharepoint_link is inconsistent
@ -126,6 +130,7 @@ class PashubService:
uprn: Optional[str],
hubspot_deal_id: Optional[str],
file_source: FileSourceEnum,
default_file_type: Optional[str] = None,
) -> List[_FileUploadRecord]:
if not uprn and not hubspot_deal_id:
return []
@ -152,7 +157,7 @@ class PashubService:
uprn=int(uprn) if uprn else None,
hubspot_deal_id=hubspot_deal_id,
file_source=file_source.value,
file_type=get_file_type_string(filename),
file_type=get_file_type_string(filename) or default_file_type,
)
file_paths.append(file_path)
uploaded_files.append(uploaded_file)