mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-24 14:07:03 +01:00
Sanity check in case add member fails
This commit is contained in:
parent
dfd974db53
commit
a9a261634a
@ -388,7 +388,9 @@ def create_authenticated_user():
|
|||||||
abort(404)
|
abort(404)
|
||||||
if not checkUserBanned(guild_id):
|
if not checkUserBanned(guild_id):
|
||||||
if not check_user_in_guild(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'])
|
add_member = discord_api.add_guild_member(guild_id, session['user_id'], session['user_keys']['access_token'])
|
||||||
|
if not add_member["success"]:
|
||||||
|
abort(403)
|
||||||
db_user = db.session.query(AuthenticatedUsers).filter(and_(AuthenticatedUsers.guild_id == guild_id, AuthenticatedUsers.client_id == session['user_id'])).first()
|
db_user = db.session.query(AuthenticatedUsers).filter(and_(AuthenticatedUsers.guild_id == guild_id, AuthenticatedUsers.client_id == session['user_id'])).first()
|
||||||
if not db_user:
|
if not db_user:
|
||||||
db_user = AuthenticatedUsers(guild_id, session['user_id'])
|
db_user = AuthenticatedUsers(guild_id, session['user_id'])
|
||||||
|
Loading…
Reference in New Issue
Block a user