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()