From 08a3477e88b631091dab1fe941f4fa031cbf636c Mon Sep 17 00:00:00 2001 From: j Date: Sat, 23 Feb 2019 12:32:20 +0530 Subject: [PATCH] cleanup users --- oml/library.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oml/library.py b/oml/library.py index 90798aa..eee921e 100644 --- a/oml/library.py +++ b/oml/library.py @@ -446,6 +446,9 @@ def cleanup_peers(): other_peers[id] = peer.info['peers'][id] known_peers.add(id) for u in user.models.User.query.filter(user.models.User.id.notin_(list(known_peers))): - if not 'local' in u.info and not u.pending: + if state.nodes and u.id in state.nodes.local: + continue + if not u.pending: state.db.session.delete(u) + state.db.session.commit()