|
|
@@ -598,36 +598,40 @@ def updatePasswordFromLogin(request,uuid):
|
|
|
data['uuid'] = uuid
|
|
|
print('uuid',uuid)
|
|
|
|
|
|
+ a = None
|
|
|
+ d = None
|
|
|
+ # 1 tentativo su codice fiscale
|
|
|
+ try:
|
|
|
+ a = Utente.objects.get(uuid=uuid)
|
|
|
+ d = 'u'
|
|
|
+ except Utente.DoesNotExist as dne:
|
|
|
+ print('informazione non trovata tra gli utente')
|
|
|
+ try:
|
|
|
+ a = Amministratore.objects.get(uuid=uuid)
|
|
|
+ d = 'a'
|
|
|
+ except Amministratore.DoesNotExist as dne:
|
|
|
+ print('informazione non trovata tra i login amministratotore')
|
|
|
+
|
|
|
+
|
|
|
+ if d == 'u':
|
|
|
+ print('utente',a.codicefiscale)
|
|
|
+ elif d == 'a':
|
|
|
+ print('amministratore',a.login)
|
|
|
+ else:
|
|
|
+ print("Furbata: l'uuid non si trova",uuid)
|
|
|
+ return HttpResponseRedirect(reverse("login:start"))
|
|
|
+
|
|
|
+ print('record',a.id,a.nome,a.uuid,d)
|
|
|
+
|
|
|
+ # ora effettuiamo il controllo
|
|
|
if request.method == 'POST':
|
|
|
print('updatePasswordFromLogin: un tasto è stato premuto')
|
|
|
formupdatepasswordlogin = formUpdatePasswordLogin(request.POST)
|
|
|
if formupdatepasswordlogin.is_valid():
|
|
|
- cfisc = formupdatepasswordlogin.cleaned_data.get('cfisc')
|
|
|
pin1 = formupdatepasswordlogin.cleaned_data.get('pin1')
|
|
|
pin2 = formupdatepasswordlogin.cleaned_data.get('pin2')
|
|
|
uuidl = formupdatepasswordlogin.cleaned_data.get('uuid')
|
|
|
- print('stato',cfisc,pin1,pin2,uuidl)
|
|
|
-
|
|
|
- a = None
|
|
|
- d = None
|
|
|
- # 1 tentativo su codice fiscale
|
|
|
- try:
|
|
|
- a = Utente.objects.get(uuid=uuidl)
|
|
|
- d = 'u'
|
|
|
- except Utente.DoesNotExist as dne:
|
|
|
- print('informazione non trovata tra i codici fiscali utente')
|
|
|
- try:
|
|
|
- a = Amministratore.objects.get(uuid=uuidl)
|
|
|
- d = 'a'
|
|
|
- except Amministratore.DoesNotExist as dne:
|
|
|
- print('informazione non trovata tra i login amministratotore')
|
|
|
-
|
|
|
- print('record',a.id,a.nome,a.uuid,d)
|
|
|
-
|
|
|
- if d == 'u':
|
|
|
- print('utente',a.codicefiscale)
|
|
|
- if d == 'a':
|
|
|
- print('amministratore',a.login)
|
|
|
+ print('stato',pin1,pin2,uuidl)
|
|
|
|
|
|
if uuidl == a.uuid:
|
|
|
print('uuid corrisponde',uuidl,uuid)
|
|
|
@@ -667,7 +671,6 @@ def updatePasswordFromLogin(request,uuid):
|
|
|
else:
|
|
|
print('request non valida', request.POST)
|
|
|
tmp = dict()
|
|
|
- tmp['cfisc'] = ""
|
|
|
tmp['uuid'] = uuid
|
|
|
tmp['pin1'] = ""
|
|
|
tmp['pin2'] = ""
|