Cast user_id to string during comparison to fix guest posting

This commit is contained in:
Jeremy Zhang 2017-09-09 02:30:23 +00:00
parent ded1a48ef1
commit 207e13b639

View File

@ -217,7 +217,7 @@ def post():
channel_id = request.form.get('channel_id') channel_id = request.form.get('channel_id')
content = request.form.get('content') content = request.form.get('content')
if "user_id" in session: if "user_id" in session:
dbUser = GuildMembers.query.filter(GuildMembers.guild_id == guild_id).filter(GuildMembers.user_id == session['user_id']).first() dbUser = GuildMembers.query.filter(GuildMembers.guild_id == guild_id).filter(GuildMembers.user_id == str(session['user_id'])).first()
else: else:
dbUser = None dbUser = None
if user_unauthenticated(): if user_unauthenticated():