Range through the userids for OBO

This commit is contained in:
Jeremy Zhang 2018-03-28 06:16:55 +00:00
parent 79ae3b3c92
commit 2173fc631d

View File

@ -398,9 +398,14 @@ def voting_get():
for u in users: for u in users:
uid = u.user_id # Let's fix this OBO error uid = u.user_id # Let's fix this OBO error
gmember = db.session.query(GuildMembers).filter(GuildMembers.user_id == uid).first() gmember = db.session.query(GuildMembers).filter(GuildMembers.user_id == uid).first()
count = 0
if not gmember: if not gmember:
uid = u.user_id + 1 uid = uid - 10
while uid < u.user_id + 10:
gmember = db.session.query(GuildMembers).filter(GuildMembers.user_id == uid).first() gmember = db.session.query(GuildMembers).filter(GuildMembers.user_id == uid).first()
if gmember:
break
uid = uid + 1
if not gmember: if not gmember:
uid = u.user_id - 1 uid = u.user_id - 1
all_users.append({ all_users.append({