Revision 7f47d7ec snf-astakos-app/astakos/im/api/admin.py

b/snf-astakos-app/astakos/im/api/admin.py
84 84
                        raise Unauthorized('Access denied')
85 85
                    try:
86 86
                        user = AstakosUser.objects.get(auth_token=x_auth_token)
87
                        ## Check if the token has expired.
88
                        #if (time() - mktime(user.auth_token_expires.timetuple())) > 0:
89
                        #    raise Unauthorized('Authentication expired')
90 87
                        if not user.has_perms(perms):
91 88
                            raise Forbidden('Unauthorized request')
92 89
                    except AstakosUser.DoesNotExist, e:
......
196 193
    cookie = urllib.unquote(request.COOKIES.get(COOKIE_NAME, ''))
197 194
    email = cookie.partition('|')[0]
198 195
    try:
196
        if not email:
197
            raise ValueError
199 198
        user = AstakosUser.objects.get(email=email, is_active=True)
200 199
    except AstakosUser.DoesNotExist:
201 200
        pass
201
    except ValueError:
202
        pass
202 203
    else:
203 204
        l = []
204 205
        l.append({ 'url': absolute(reverse('astakos.im.views.index')),

Also available in: Unified diff