git://git.onelab.eu
/
unfold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bff32ab
)
Fix: Activation email if user is in PLE - RT 81
author
Loic Baron
<loic.baron@lip6.fr>
Tue, 19 Aug 2014 08:17:08 +0000
(10:17 +0200)
committer
Loic Baron
<loic.baron@lip6.fr>
Tue, 19 Aug 2014 08:17:08 +0000
(10:17 +0200)
portal/emailactivationview.py
patch
|
blob
|
history
diff --git
a/portal/emailactivationview.py
b/portal/emailactivationview.py
index
a485bc3
..
4680256
100644
(file)
--- a/
portal/emailactivationview.py
+++ b/
portal/emailactivationview.py
@@
-40,7
+40,6
@@
class ActivateEmailView(FreeAccessView, ThemeView):
hash_code=value
if PendingUser.objects.filter(email_hash__iexact = hash_code).filter(status__iexact = 'False'):
activation = 'success'
hash_code=value
if PendingUser.objects.filter(email_hash__iexact = hash_code).filter(status__iexact = 'False'):
activation = 'success'
- PendingUser.objects.filter(email_hash__iexact = hash_code).update(status='True')
# AUTO VALIDATION of PLE enabled users (only for OneLab Portal)
if self.theme == "onelab":
# AUTO VALIDATION of PLE enabled users (only for OneLab Portal)
if self.theme == "onelab":
@@
-50,6
+49,10
@@
class ActivateEmailView(FreeAccessView, ThemeView):
# TODO in SFA XXX We need a Resolve based on email
# TODO maybe we can use MyPLC API for PLE
pending_users = PendingUser.objects.filter(email_hash__iexact = hash_code)
# TODO in SFA XXX We need a Resolve based on email
# TODO maybe we can use MyPLC API for PLE
pending_users = PendingUser.objects.filter(email_hash__iexact = hash_code)
+
+ # by default user is not in PLE
+ ple_user_enabled = False
+
if pending_users:
pending_user = pending_users[0]
pending_user_request = make_request_user(pending_user)
if pending_users:
pending_user = pending_users[0]
pending_user_request = make_request_user(pending_user)
@@
-61,8
+64,6
@@
class ActivateEmailView(FreeAccessView, ThemeView):
if 'enabled' in result and result['enabled']==True:
ple_user_enabled = True
break
if 'enabled' in result and result['enabled']==True:
ple_user_enabled = True
break
- else:
- ple_user_enabled = False
# Auto Validation
if ple_user_enabled:
# Auto Validation
if ple_user_enabled:
@@
-96,6
+97,7
@@
class ActivateEmailView(FreeAccessView, ThemeView):
# import traceback
# traceback.print_exc()
# import traceback
# traceback.print_exc()
+ PendingUser.objects.filter(email_hash__iexact = hash_code).update(status='True')
else:
activation = 'failed'
else:
activation = 'failed'