Skip to content

Commit

Permalink
simplify the upload service and use realname or filename at download …
Browse files Browse the repository at this point in the history
…and display
  • Loading branch information
etchegom committed Oct 14, 2024
1 parent 0fe5ba8 commit c3aae84
Show file tree
Hide file tree
Showing 15 changed files with 384 additions and 314 deletions.
8 changes: 4 additions & 4 deletions conventions/fixtures/conventions_for_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"date_fin_conventionnement": null,
"financement": "PLUS",
"fond_propre": null,
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"f7f5151c-6031-4ba4-a041-12666b700def\": {\"uuid\": \"f7f5151c-6031-4ba4-a041-12666b700def\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"a9a47df6-5493-43be-bd21-e86c3d6e79b4\": {\"uuid\": \"a9a47df6-5493-43be-bd21-e86c3d6e79b4\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"f7f5151c-6031-4ba4-a041-12666b700def\": {\"uuid\": \"f7f5151c-6031-4ba4-a041-12666b700def\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"a9a47df6-5493-43be-bd21-e86c3d6e79b4\": {\"uuid\": \"a9a47df6-5493-43be-bd21-e86c3d6e79b4\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"attached": null,
"statut": "1. Projet",
"soumis_le": null,
Expand Down Expand Up @@ -123,7 +123,7 @@
"date_fin_conventionnement": null,
"financement": "PLAI",
"fond_propre": null,
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"94520361-d943-44ee-a0c0-5ec93c85e2c5\": {\"uuid\": \"94520361-d943-44ee-a0c0-5ec93c85e2c5\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"1a22e492-8d50-4b53-8336-9f925581d8fd\": {\"uuid\": \"1a22e492-8d50-4b53-8336-9f925581d8fd\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"94520361-d943-44ee-a0c0-5ec93c85e2c5\": {\"uuid\": \"94520361-d943-44ee-a0c0-5ec93c85e2c5\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"1a22e492-8d50-4b53-8336-9f925581d8fd\": {\"uuid\": \"1a22e492-8d50-4b53-8336-9f925581d8fd\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"attached": null,
"statut": "1. Projet",
"soumis_le": null,
Expand Down Expand Up @@ -206,7 +206,7 @@
"date_fin_conventionnement": null,
"financement": "PLUS",
"fond_propre": null,
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"62ddb671-f021-4ae6-8de3-403ba7d80c2c\": {\"uuid\": \"62ddb671-f021-4ae6-8de3-403ba7d80c2c\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"e309ed33-67e0-4fb3-89d9-35db87a9849f\": {\"uuid\": \"e309ed33-67e0-4fb3-89d9-35db87a9849f\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"62ddb671-f021-4ae6-8de3-403ba7d80c2c\": {\"uuid\": \"62ddb671-f021-4ae6-8de3-403ba7d80c2c\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"e309ed33-67e0-4fb3-89d9-35db87a9849f\": {\"uuid\": \"e309ed33-67e0-4fb3-89d9-35db87a9849f\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"attached": null,
"statut": "1. Projet",
"soumis_le": null,
Expand Down Expand Up @@ -289,7 +289,7 @@
"date_fin_conventionnement": null,
"financement": "PLAI",
"fond_propre": null,
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"11df0962-e377-4133-a128-6a749256c4c8\": {\"uuid\": \"11df0962-e377-4133-a128-6a749256c4c8\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"46caa33d-7e6d-440c-a652-75cab45f4dba\": {\"uuid\": \"46caa33d-7e6d-440c-a652-75cab45f4dba\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"commentaires": "{\"text\": \"this is a test\", \"files\": {\"11df0962-e377-4133-a128-6a749256c4c8\": {\"uuid\": \"11df0962-e377-4133-a128-6a749256c4c8\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"46caa33d-7e6d-440c-a652-75cab45f4dba\": {\"uuid\": \"46caa33d-7e6d-440c-a652-75cab45f4dba\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"attached": null,
"statut": "1. Projet",
"soumis_le": null,
Expand Down
5 changes: 4 additions & 1 deletion conventions/services/convention_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,10 @@ def get_files_attached(convention):

files = UploadedFile.objects.filter(uuid__in=attached_files)
for object_file in files:
file = UploadService().get_file(object_file.filepath(convention.uuid))
file = default_storage.open(
name=object_file.filepath(convention.uuid),
mode="rb",
)
local_path = (
settings.MEDIA_ROOT
/ "conventions"
Expand Down
37 changes: 19 additions & 18 deletions conventions/views/conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
from programmes.models import Financement, NatureLogement
from programmes.services import LoyerRedevanceUpdateComputer
from upload.models import UploadedFile
from upload.services import UploadService

template_sent = "conventions/sent.html"

Expand Down Expand Up @@ -373,11 +372,16 @@ def get_or_generate_cerfa(request, convention_uuid):
if len(files) > 0:
file_dict = files[0]
uploaded_file = UploadedFile.objects.get(uuid=file_dict["uuid"])
file = UploadService().get_file(uploaded_file.filepath(convention_uuid))

return FileResponse(
file,
filename=file_dict["filename"],
default_storage.open(
name=uploaded_file.filepath(convention_uuid),
mode="rb",
),
filename=(
file_dict["realname"]
if "realname" in file_dict
else file_dict["filename"]
),
as_attachment=True,
)
return generate_convention(request, convention_uuid)
Expand Down Expand Up @@ -662,6 +666,8 @@ def resiliation_start(request, convention_uuid):
def display_pdf(request, convention_uuid):
# récupérer le doc PDF
convention = Convention.objects.get(uuid=convention_uuid)
convention_path = f"conventions/{convention.uuid}/convention_docs"

filename = None
if (
convention.statut
Expand All @@ -673,25 +679,20 @@ def display_pdf(request, convention_uuid):
ConventionStatut.A_SIGNER.label,
]
and convention.nom_fichier_signe
and default_storage.exists(
f"conventions/{convention.uuid}/convention_docs/{convention.nom_fichier_signe}"
)
and default_storage.exists(f"{convention_path}/{convention.nom_fichier_signe}")
):
filename = convention.nom_fichier_signe
elif default_storage.exists(
f"conventions/{convention.uuid}/convention_docs/{convention.uuid}.pdf"
):
elif default_storage.exists(f"{convention_path}/{convention.uuid}.pdf"):
filename = f"{convention.uuid}.pdf"
elif default_storage.exists(
f"conventions/{convention.uuid}/convention_docs/{convention.uuid}.docx"
):
elif default_storage.exists(f"{convention_path}/{convention.uuid}.docx"):
filename = f"{convention.uuid}.docx"

if filename:
return FileResponse(
UploadService(
convention_dirpath=f"conventions/{convention.uuid}/convention_docs",
filename=filename,
).get_file(),
default_storage.open(
name=f"{convention_path}/{filename}",
mode="rb",
),
filename=filename,
)

Expand Down
16 changes: 8 additions & 8 deletions programmes/fixtures/programmes_for_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"nb_locaux_commerciaux": 5,
"nb_bureaux": 25,
"autres_locaux_hors_convention": "quelques uns",
"reference_publication_acte": "{\"text\": \"this is a test\", \"files\": {\"8c9b6894-1de4-4b45-bd50-e9416dd3ee6b\": {\"uuid\": \"8c9b6894-1de4-4b45-bd50-e9416dd3ee6b\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"0c48af64-c852-4e6f-ae86-265615913ac9\": {\"uuid\": \"0c48af64-c852-4e6f-ae86-265615913ac9\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"reference_publication_acte": "{\"text\": \"this is a test\", \"files\": {\"8c9b6894-1de4-4b45-bd50-e9416dd3ee6b\": {\"uuid\": \"8c9b6894-1de4-4b45-bd50-e9416dd3ee6b\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"0c48af64-c852-4e6f-ae86-265615913ac9\": {\"uuid\": \"0c48af64-c852-4e6f-ae86-265615913ac9\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"effet_relatif": "n'importe quoi",
"certificat_adressage": "n'importe quoi",
"reference_cadastrale": "{\"text\": \"this is a test\", \"files\": {\"98ae5093-ff07-4008-bb61-6fa5e7e34fd2\": {\"uuid\": \"98ae5093-ff07-4008-bb61-6fa5e7e34fd2\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"daf5cc14-e5fd-4125-affa-3d7003b1dcc8\": {\"uuid\": \"daf5cc14-e5fd-4125-affa-3d7003b1dcc8\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"reference_cadastrale": "{\"text\": \"this is a test\", \"files\": {\"98ae5093-ff07-4008-bb61-6fa5e7e34fd2\": {\"uuid\": \"98ae5093-ff07-4008-bb61-6fa5e7e34fd2\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"daf5cc14-e5fd-4125-affa-3d7003b1dcc8\": {\"uuid\": \"daf5cc14-e5fd-4125-affa-3d7003b1dcc8\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"permis_construire": "123 456 789 ABC",
"date_achevement_previsible": "2024-01-02",
"date_achat": "2022-01-02",
Expand Down Expand Up @@ -58,12 +58,12 @@
"nb_locaux_commerciaux": 5,
"nb_bureaux": 25,
"autres_locaux_hors_convention": "quelques uns",
"vendeur": "{\"text\": \"this is a test\", \"files\": {\"cff0c56e-40bd-409b-8116-d50430db2239\": {\"uuid\": \"cff0c56e-40bd-409b-8116-d50430db2239\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"a94a4c00-1ee1-4fbd-b200-a758379ec37f\": {\"uuid\": \"a94a4c00-1ee1-4fbd-b200-a758379ec37f\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"vendeur": "{\"text\": \"this is a test\", \"files\": {\"cff0c56e-40bd-409b-8116-d50430db2239\": {\"uuid\": \"cff0c56e-40bd-409b-8116-d50430db2239\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"a94a4c00-1ee1-4fbd-b200-a758379ec37f\": {\"uuid\": \"a94a4c00-1ee1-4fbd-b200-a758379ec37f\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"acquereur": "n'importe quoi",
"reference_notaire": "{\"text\": \"this is a test\", \"files\": {\"45079d28-f737-44b7-9f6a-c1e8367072a5\": {\"uuid\": \"45079d28-f737-44b7-9f6a-c1e8367072a5\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"df747b0d-62c7-4fb3-9fda-37f3b682df80\": {\"uuid\": \"df747b0d-62c7-4fb3-9fda-37f3b682df80\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"reference_publication_acte": "{\"text\": \"this is a test\", \"files\": {\"80ecbde5-da41-4ece-a35b-19665b8b2b12\": {\"uuid\": \"80ecbde5-da41-4ece-a35b-19665b8b2b12\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"ae57c1f9-62cb-46df-b496-2f4c78429a4c\": {\"uuid\": \"ae57c1f9-62cb-46df-b496-2f4c78429a4c\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"acte_de_propriete": "{\"text\": \"this is a test\", \"files\": {\"8f25d1cd-cb65-4596-9f74-758c6eb00283\": {\"uuid\": \"8f25d1cd-cb65-4596-9f74-758c6eb00283\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"4a5ca2ab-f739-4b9d-ba71-4412268e78f4\": {\"uuid\": \"4a5ca2ab-f739-4b9d-ba71-4412268e78f4\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"certificat_adressage": "{\"text\": \"this is a test\", \"files\": {\"4feccfda-205e-42de-b215-46e94b32ddd1\": {\"uuid\": \"4feccfda-205e-42de-b215-46e94b32ddd1\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"6441b179-5ec6-4ca5-bb64-f915f83c34ab\": {\"uuid\": \"6441b179-5ec6-4ca5-bb64-f915f83c34ab\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"reference_notaire": "{\"text\": \"this is a test\", \"files\": {\"45079d28-f737-44b7-9f6a-c1e8367072a5\": {\"uuid\": \"45079d28-f737-44b7-9f6a-c1e8367072a5\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"df747b0d-62c7-4fb3-9fda-37f3b682df80\": {\"uuid\": \"df747b0d-62c7-4fb3-9fda-37f3b682df80\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"reference_publication_acte": "{\"text\": \"this is a test\", \"files\": {\"80ecbde5-da41-4ece-a35b-19665b8b2b12\": {\"uuid\": \"80ecbde5-da41-4ece-a35b-19665b8b2b12\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"ae57c1f9-62cb-46df-b496-2f4c78429a4c\": {\"uuid\": \"ae57c1f9-62cb-46df-b496-2f4c78429a4c\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"acte_de_propriete": "{\"text\": \"this is a test\", \"files\": {\"8f25d1cd-cb65-4596-9f74-758c6eb00283\": {\"uuid\": \"8f25d1cd-cb65-4596-9f74-758c6eb00283\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"4a5ca2ab-f739-4b9d-ba71-4412268e78f4\": {\"uuid\": \"4a5ca2ab-f739-4b9d-ba71-4412268e78f4\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"certificat_adressage": "{\"text\": \"this is a test\", \"files\": {\"4feccfda-205e-42de-b215-46e94b32ddd1\": {\"uuid\": \"4feccfda-205e-42de-b215-46e94b32ddd1\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"6441b179-5ec6-4ca5-bb64-f915f83c34ab\": {\"uuid\": \"6441b179-5ec6-4ca5-bb64-f915f83c34ab\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"permis_construire": "123 456 789 ABC",
"date_achevement_previsible": "2024-01-02",
"date_achat": "2022-01-02",
Expand All @@ -81,7 +81,7 @@
"programme": 1,
"financement": "PLAI",
"type_habitat": "INDIVIDUEL",
"edd_classique": "{\"text\": \"this is a test\", \"files\": {\"fbb9890f-171b-402d-a35e-71e1bd791b70\": {\"uuid\": \"fbb9890f-171b-402d-a35e-71e1bd791b70\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"dccd310d-2e50-45d8-a477-db7b08ae1d71\": {\"uuid\": \"dccd310d-2e50-45d8-a477-db7b08ae1d71\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"edd_classique": "{\"text\": \"this is a test\", \"files\": {\"fbb9890f-171b-402d-a35e-71e1bd791b70\": {\"uuid\": \"fbb9890f-171b-402d-a35e-71e1bd791b70\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"realname\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"dccd310d-2e50-45d8-a477-db7b08ae1d71\": {\"uuid\": \"dccd310d-2e50-45d8-a477-db7b08ae1d71\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"realname\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"lgts_mixite_sociale_negocies": 0,
"surface_locaux_collectifs_residentiels": 0,
"cree_le": "2023-03-08T20:43:46.080Z",
Expand Down
2 changes: 1 addition & 1 deletion templates/common/display_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='fr-mx-1w dz-image'>
<img class="small_thumbnail" {% if file.thumbnail %}src='{{file.thumbnail}}'{% endif %}/>
</div>
<a class='fr-mx-1w' href='{% url 'upload:display_file' convention_uuid=convention.uuid uploaded_file_uuid=file.uuid %}'>{{file.realname}}</a>
<a class='fr-mx-1w' href='{% url 'upload:display_file' convention_uuid=convention.uuid uploaded_file_uuid=file.uuid %}'>{{file.realname|default:file.filename}}</a>
- <span class='fr-mx-1w'>{{file.size|filesizeformat}}</span>
</div>
{% endfor %}
Loading

0 comments on commit c3aae84

Please sign in to comment.