|
@@ -64,9 +64,12 @@ def welcome(request):
|
|
|
print('Richiesta cancellazione Documento',request.POST)
|
|
print('Richiesta cancellazione Documento',request.POST)
|
|
|
documento = request.POST['DeleteDocument'] # perche' lo considera una lista e non un singolo valore?
|
|
documento = request.POST['DeleteDocument'] # perche' lo considera una lista e non un singolo valore?
|
|
|
print('richiesta cancellazione documento:',documento)
|
|
print('richiesta cancellazione documento:',documento)
|
|
|
- d = Documento.objects.get(pk=documento)
|
|
|
|
|
- delete_file(d) #rimozione fisica del documento
|
|
|
|
|
- d.delete()
|
|
|
|
|
|
|
+ try:
|
|
|
|
|
+ d = Documento.objects.get(pk=documento)
|
|
|
|
|
+ delete_file(d) #rimozione fisica del documento
|
|
|
|
|
+ d.delete()
|
|
|
|
|
+ except Documento.DoesNotExist as dne:
|
|
|
|
|
+ print('il documento non esiste')
|
|
|
|
|
|
|
|
filecaricati = AdminUpload(request.POST,request.FILES)
|
|
filecaricati = AdminUpload(request.POST,request.FILES)
|
|
|
|
|
|
|
@@ -88,7 +91,7 @@ def welcome(request):
|
|
|
data['listaok'] = listaok
|
|
data['listaok'] = listaok
|
|
|
data['listanotok'] = listanotok
|
|
data['listanotok'] = listanotok
|
|
|
|
|
|
|
|
- ElencoDocumentiPerAzienda = Documento.objects.filter(azienda=azienda).order_by("utente__nome")
|
|
|
|
|
|
|
+ ElencoDocumentiPerAzienda = Documento.objects.filter(azienda=azienda).order_by("utente__nome","documento")
|
|
|
data['ElencoDocumentiPerAzienda'] = ElencoDocumentiPerAzienda
|
|
data['ElencoDocumentiPerAzienda'] = ElencoDocumentiPerAzienda
|
|
|
print("Numero documenti associati",len(ElencoDocumentiPerAzienda))
|
|
print("Numero documenti associati",len(ElencoDocumentiPerAzienda))
|
|
|
|
|
|