|
|
@@ -15,6 +15,9 @@ from random import randint
|
|
|
from config.views import *
|
|
|
import re
|
|
|
|
|
|
+import csv
|
|
|
+from io import StringIO
|
|
|
+
|
|
|
def welcome(request):
|
|
|
if not 'AdminId' in request.session or 'UserId' in request.session:
|
|
|
print("Non rilevo presensa UserId e AdminId in request.session")
|
|
|
@@ -54,6 +57,10 @@ def welcome(request):
|
|
|
if request.method == 'POST':
|
|
|
print('qualcuno ha premuto un tasto')
|
|
|
|
|
|
+ print("***********")
|
|
|
+ print(request.POST)
|
|
|
+ print("***********")
|
|
|
+
|
|
|
if 'indietro' in request.POST:
|
|
|
return HttpResponseRedirect(reverse("azienda:welcome"))
|
|
|
|
|
|
@@ -77,7 +84,22 @@ def welcome(request):
|
|
|
save_and_load_file_indice(request,fileindiceottenuto,data['azienda'],data['sede'])
|
|
|
else:
|
|
|
print('request non valida')
|
|
|
-
|
|
|
+ if 'select' in request.POST:
|
|
|
+ select = request.POST.get('select')
|
|
|
+ print('select',select,type(select))
|
|
|
+ tmplist = list()
|
|
|
+ for i in select:
|
|
|
+ print("utente",i)
|
|
|
+ if i == '0': continue
|
|
|
+ u = Utente.objects.get(pk=int(i))
|
|
|
+ tmplist.append([u.codicefiscale,u.nome,u.pin])
|
|
|
+ print("lunghezza tmplist",len(tmplist))
|
|
|
+
|
|
|
+ f = StringIO()
|
|
|
+ csv.writer(f).writerows(tmplist)
|
|
|
+ print(f.getvalue())
|
|
|
+
|
|
|
+
|
|
|
return render(request,'utente.welcome.html',data)
|
|
|
|
|
|
def edit(request):
|
|
|
@@ -340,7 +362,9 @@ def updatePasswordFromLogin(request,uuid):
|
|
|
print('uuid',uuid)
|
|
|
|
|
|
if request.method == 'POST':
|
|
|
+ print("***********")
|
|
|
print(request.POST)
|
|
|
+ print("***********")
|
|
|
formupdatepasswordlogin = formUpdatePasswordLogin(request.POST)
|
|
|
if formupdatepasswordlogin.is_valid():
|
|
|
cfisc = formupdatepasswordlogin.cleaned_data.get('cfisc')
|