Revision 08494423 snf-astakos-app/astakos/im/api/service.py

b/snf-astakos-app/astakos/im/api/service.py
66 66
                        service = Service.objects.get(auth_token=x_auth_token)
67 67

  
68 68
                        # Check if the token has expired.
69
                        if (time() - mktime(service.auth_token_expires.timetuple())) > 0:
70
                            raise Unauthorized('Authentication expired')
69
                        if service.auth_token_expires:
70
                            if (time() - mktime(service.auth_token_expires.timetuple())) > 0:
71
                                raise Unauthorized('Authentication expired')
71 72
                    except Service.DoesNotExist, e:
72 73
                        raise Unauthorized('Invalid X-Auth-Token')
73 74
                response = func(request, *args, **kwargs)

Also available in: Unified diff