correction requete dans img_upload

This commit is contained in:
2020-02-13 14:17:35 +01:00
parent b4205a18ff
commit 2069cb8d94
2 changed files with 3 additions and 3 deletions

View File

@@ -170,9 +170,9 @@ def get_docs_attaches(request, nodossier, norapport, nosection, filename):
def get_photos(request, nodossier, norapport, nosection): def get_photos(request, nodossier, norapport, nosection):
societe = nodossier[0:2] societe = nodossier[0:2]
nochantier = int(nodossier[3:]) nochantier = int(nodossier[3:])
query = """SELECT * FROM dossier_attaches WHERE nomrep = 'DOCS_ATTACHES' AND societe = societe AND nochantier = :nochantier query = """SELECT * FROM dossier_attaches WHERE nomrep = 'DOCS_ATTACHES' AND societe = :societe AND nochantier = :nochantier
AND nodossier = :norapport AND nosection = :nosection AND UPPER(RIGHT(nomfichier,3)) <> 'PDF' ORDER BY cree_le;""" AND nodossier = :norapport AND nosection = :nosection AND UPPER(RIGHT(nomfichier,3)) <> 'PDF' ORDER BY cree_le;"""
results = request.dbsession.execute(query, {'nochantier': nochantier, 'norapport': norapport, 'nosection': nosection}).fetchall() results = request.dbsession.execute(query, {'societe': societe, 'nochantier': nochantier, 'norapport': norapport, 'nosection': nosection}).fetchall()
return results return results
def delete_photos(request, nodossier, norapport, nosection, nomfic): def delete_photos(request, nodossier, norapport, nosection, nomfic):

View File

@@ -381,7 +381,7 @@ def upload_img(request):
request.session.flash('%s : Ce fichier est téléchargé avec succès.' % input_name, 'success') request.session.flash('%s : Ce fichier est téléchargé avec succès.' % input_name, 'success')
# lire tous les photos attachées # lire tous les photos attachées
photos = get_photos(request, nodossier, norapport, nosection) photos = get_photos(request, nodossier, int(norapport), int(nosection))
return { return {
'page_title': titre, 'page_title': titre,