From f9867b3e2bc8c15ab18e900b7b3b8333f62f74ff Mon Sep 17 00:00:00 2001 From: ewandor Date: Fri, 24 Mar 2023 13:42:07 +0100 Subject: [PATCH] Changing the contract file name to the contract label. Updating label content with a dash --- back/app/contract/models.py | 2 +- back/app/contract/print/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/back/app/contract/models.py b/back/app/contract/models.py index 67779a77..0f610467 100644 --- a/back/app/contract/models.py +++ b/back/app/contract/models.py @@ -190,7 +190,7 @@ class Contract(CrudDocument): for p in values['parties']: contract_label = contract_label + f" - {p.entity.label}" - contract_label = contract_label + f" {values['date'].strftime('%m/%d/%Y')}" + contract_label = contract_label + f" - {values['date'].strftime('%m/%d/%Y')}" return contract_label return v diff --git a/back/app/contract/print/__init__.py b/back/app/contract/print/__init__.py index 90a1e8eb..10800110 100644 --- a/back/app/contract/print/__init__.py +++ b/back/app/contract/print/__init__.py @@ -130,7 +130,7 @@ async def create_pdf(contract_id: str) -> str: return FileResponse( contract_path, media_type="application/pdf", - filename=contract.name) + filename=contract.label) def retrieve_signature_png(filepath):