git://git.onelab.eu
/
myslice.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clear credentials of a list of mails (post)
[myslice.git]
/
rest
/
credentials.py
diff --git
a/rest/credentials.py
b/rest/credentials.py
index
fa1f9b8
..
d63babf
100644
(file)
--- a/
rest/credentials.py
+++ b/
rest/credentials.py
@@
-2,16
+2,20
@@
from django.http import HttpResponse
from portal.actions import clear_user_creds
import json
from portal.actions import clear_user_creds
import json
-def dispatch(request, action
, object
):
+def dispatch(request, action):
if (action == 'clear') :
if (action == 'clear') :
- try :
- res = clear_user_creds(request, object)
- except :
- pass
+ res=[]
+ emails = request.POST.getlist('emails[]')
+ if emails :
+ for email in emails :
+ try :
+ res.append(clear_user_creds(request, email))
+ except :
+ pass
- if
res is not None
:
- ret = { "ret" : 1, "email" : res }
+ if
not res
:
+ ret = { "ret" : 1, "email
s
" : res }
else :
ret = { "ret" : 0 }
else :
ret = { "ret" : 0 }