def is_authenticated self sess session get sess if sess is not None se

1
2
3
4
5
6
7
def is_authenticated(self):
sess = session.get('sess')
if sess is not None:
server_sess = request.remote_addr + self.sess
return hashlib.md5(server_sess).hexdigest() == sess
else:
return False