Adjust OffByOne error checking in admin voting page

This commit is contained in:
Jeremy Zhang 2018-03-28 06:09:42 +00:00
parent e8d37a791c
commit 79ae3b3c92

View File

@ -400,6 +400,9 @@ def voting_get():
gmember = db.session.query(GuildMembers).filter(GuildMembers.user_id == uid).first() gmember = db.session.query(GuildMembers).filter(GuildMembers.user_id == uid).first()
if not gmember: if not gmember:
uid = u.user_id + 1 uid = u.user_id + 1
gmember = db.session.query(GuildMembers).filter(GuildMembers.user_id == uid).first()
if not gmember:
uid = u.user_id - 1
all_users.append({ all_users.append({
"id": u.id, "id": u.id,
"user_id": uid, "user_id": uid,