from portal.actions import clear_user_creds
import json
-def dispatch(request, action, object):
+def dispatch(request, action):
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, "emails" : res }
else :
ret = { "ret" : 0 }