From b426df1f362e846c66f4d8fe0ad2c71fd761ac6a Mon Sep 17 00:00:00 2001 From: Phuoc CAO Date: Fri, 14 Jun 2019 12:46:01 +0200 Subject: [PATCH] =?UTF-8?q?augmenter=20plafond=20taille=20fichier=20upload?= =?UTF-8?q?=20=C3=A0=203=20Mo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mondumas/static/link2DEVFAC14.txt | 6 ++++++ mondumas/templates/dossier/upload_img.pt | 2 +- mondumas/templates/layouts/global_layout.pt | 2 +- mondumas/views/dossier.py | 18 ++++++++++++------ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/mondumas/static/link2DEVFAC14.txt b/mondumas/static/link2DEVFAC14.txt index 0998e46..c7b4456 100644 --- a/mondumas/static/link2DEVFAC14.txt +++ b/mondumas/static/link2DEVFAC14.txt @@ -5,3 +5,9 @@ mklink /J DEVFAC C:\DEVFAC14 dans le dossier static : mklink /D DEVFAC \\SRVTSE\DEVFAC14 dans le dossier c:\ : mklink /D DEVFAC14 \\SRVTSE\DEVFAC14 +-- Debian server +Voir tuto suivant pour monter un dossier partagé de Windows +https://www.caotek.fr/blog/acceder-a-un-dossier-partage-sur-windows-a-partir-de-linux + +puis créer un lien symbolique dans le dossier mondumas/static +ln -s /mnt/devfac14 DEVFAC \ No newline at end of file diff --git a/mondumas/templates/dossier/upload_img.pt b/mondumas/templates/dossier/upload_img.pt index 4ad0e3d..5fc3a6a 100644 --- a/mondumas/templates/dossier/upload_img.pt +++ b/mondumas/templates/dossier/upload_img.pt @@ -30,7 +30,7 @@
diff --git a/mondumas/templates/layouts/global_layout.pt b/mondumas/templates/layouts/global_layout.pt index 78e674c..f200f1a 100644 --- a/mondumas/templates/layouts/global_layout.pt +++ b/mondumas/templates/layouts/global_layout.pt @@ -19,7 +19,7 @@ - + diff --git a/mondumas/views/dossier.py b/mondumas/views/dossier.py index 2670f25..092008b 100644 --- a/mondumas/views/dossier.py +++ b/mondumas/views/dossier.py @@ -310,9 +310,9 @@ def upload_doc(request): with open(temp_file_path, 'wb') as output_file: shutil.copyfileobj(input_file, output_file) - # controler la taille du fichier < 2 Mo + # controler la taille du fichier < 3 Mo filesize = round(os.path.getsize(temp_file_path) / 1024) - if filesize > 2048 : + if filesize > 3076 : os.remove(temp_file_path) request.session.flash("La taille de ce fichier dépasse la limite autorisée. Téléchargement impossible.", 'warning') else: @@ -384,9 +384,9 @@ def upload_img(request): with open(temp_file_path, 'wb') as output_file: shutil.copyfileobj(input_file, output_file) - # controler la taille du fichier < 2 Mo + # controler la taille du fichier < 3 Mo filesize = round(os.path.getsize(temp_file_path) / 1024) - if filesize > 2048 : + if filesize > 3076 : os.remove(temp_file_path) request.session.flash("La taille de ce fichier dépasse la limite autorisée. Téléchargement impossible.", 'warning') else: @@ -579,7 +579,6 @@ def rdf_view(request): dest = "mondumas/static/DEVFAC/DOCS_ATTACHES/PL/%s/%s" % (str(rapport.nochantier), filename) origin = request.route_url('rdf_rapport', no_id=norapport) config = pdfkit.configuration(wkhtmltopdf="C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe") - # import pdb;pdb.set_trace() try: pdfkit.from_url(origin, dest, configuration=config, options=options) except: @@ -626,11 +625,17 @@ def rdf_rapport(request): # lire le rapport rapport = get_rapport_by_no_id(request, norapport) nodossier = 'PL-' + str(rapport.nochantier) + if rapport.date_rapport: date_rapport = rapport.date_rapport.strftime('%d-%m-%Y') else: date_rapport = '' - + + if rapport.date_relu: + date_relu = rapport.date_relu.strftime('%d-%m-%Y') + else: + date_relu = '' + # lire tous les photos attachées photos = get_photos(request, rapport.nochantier, norapport) @@ -643,6 +648,7 @@ def rdf_rapport(request): 'nochantier': rapport.nochantier, 'norapport': norapport, 'date_rapport': date_rapport, + 'date_relu': date_relu, 'photos': photos, 'docs_url': request.static_url(request.registry.settings['mondumas.devfac_url']), }