bug générer demande MAIF + suppression photo
This commit is contained in:
@@ -189,6 +189,12 @@ def get_photos(request, nodossier, norapport, nosection):
|
||||
def delete_photos(request, nodossier, norapport, nosection, nomfic):
|
||||
societe = nodossier[0:2]
|
||||
nochantier = int(nodossier[3:])
|
||||
|
||||
# supprimer d'abord le fichier
|
||||
file_path = '%s/%s/%s/%s/%s' % (request.registry.settings['mondumas.devfac_dir'], societe, nochantier, norapport, nomfic)
|
||||
if os.path.exists(file_path):
|
||||
os.remove(file_path)
|
||||
|
||||
query = "DELETE FROM dossier_attaches WHERE nomrep='DOCS_ATTACHES' AND societe=:societe AND nochantier=:nochantier AND nodossier=:norapport AND nosection=:nosection AND nomfichier=:nomfic;"
|
||||
execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'norapport': norapport, 'nosection': nosection, 'nomfic': nomfic})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user