cleanup users
This commit is contained in:
parent
739cfd8c9d
commit
08a3477e88
1 changed files with 4 additions and 1 deletions
|
@ -446,6 +446,9 @@ def cleanup_peers():
|
||||||
other_peers[id] = peer.info['peers'][id]
|
other_peers[id] = peer.info['peers'][id]
|
||||||
known_peers.add(id)
|
known_peers.add(id)
|
||||||
for u in user.models.User.query.filter(user.models.User.id.notin_(list(known_peers))):
|
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.delete(u)
|
||||||
|
|
||||||
state.db.session.commit()
|
state.db.session.commit()
|
||||||
|
|
Loading…
Reference in a new issue