|
|
@@ -153,10 +153,15 @@ def welcome(request):
|
|
|
else:
|
|
|
print('form non valida')
|
|
|
print('richiesta da cercare',valoredacercare)
|
|
|
- nome = data['utenti'].filter(nome__icontains=valoredacercare)
|
|
|
- codicefiscale = data['utenti'].filter(codicefiscale__icontains=valoredacercare)
|
|
|
+ try:
|
|
|
+ nome = data['utenti'].filter(nome__icontains=valoredacercare)
|
|
|
+ codicefiscale = data['utenti'].filter(codicefiscale__icontains=valoredacercare)
|
|
|
+ data['utenti'] = dict(Counter(nome) + Counter(codicefiscale))
|
|
|
+ except AttributeError as ae:
|
|
|
+ print("Errore, la lista utenti e' vuota")
|
|
|
+ data['utenti'] = dic()
|
|
|
+
|
|
|
data['formcerca'] = formcerca
|
|
|
- data['utenti'] = dict(Counter(nome) + Counter(codicefiscale))
|
|
|
|
|
|
|
|
|
if 'MultipleCSVSelect' in request.POST:
|