From b0acab060a978f6dc7cd4cf198f0dcce4bce8691 Mon Sep 17 00:00:00 2001 From: "Jeremy \"EndenDragon\" Zhang" Date: Sat, 13 May 2017 14:27:47 -0700 Subject: [PATCH] Add user to guild first Might fix the authed discord user feature... --- webapp/titanembeds/blueprints/api/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 149e05c..cbb7e58 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -398,13 +398,13 @@ def create_authenticated_user(): if not check_guild_existance(guild_id): abort(404) if not checkUserBanned(guild_id): + if not check_user_in_guild(guild_id): + discord_api.add_guild_member(guild_id, session['user_id'], session['user_keys']['access_token']) db_user = db.session.query(AuthenticatedUsers).filter(and_(AuthenticatedUsers.guild_id == guild_id, AuthenticatedUsers.client_id == session['user_id'])).first() if not db_user: db_user = AuthenticatedUsers(guild_id, session['user_id']) db.session.add(db_user) db.session.commit() - if not check_user_in_guild(guild_id): - discord_api.add_guild_member(guild_id, session['user_id'], session['user_keys']['access_token']) status = update_user_status(guild_id, session['username']) return jsonify(status=status) else: