Skip to content

Commit 8244f42

Browse files
authored
Fix handle already associated check in identify (cheran-senthil#490)
* Fix handle already associated check in identify * fix
1 parent c2a04ea commit 8244f42

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tle/cogs/handles.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ async def rget(self, ctx, handle: str):
417417
raise HandleCogError(f'Discord username for `{handle}` not found in database')
418418
user = cf_common.user_db.fetch_cf_user(handle)
419419
member = ctx.guild.get_member(user_id)
420+
if member is None:
421+
raise HandleCogError(f'{user_id} not found in the guild')
420422
embed = _make_profile_embed(member, user, mode='get')
421423
await ctx.send(embed=embed)
422424

tle/util/db/user_db_conn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def get_handle(self, user_id, guild_id):
399399
def get_user_id(self, handle, guild_id):
400400
query = ('SELECT user_id '
401401
'FROM user_handle '
402-
'WHERE UPPER(handle) = UPPER(?) AND guild_id = ? AND active = 1')
402+
'WHERE UPPER(handle) = UPPER(?) AND guild_id = ?')
403403
res = self.conn.execute(query, (handle, guild_id)).fetchone()
404404
return int(res[0]) if res else None
405405

0 commit comments

Comments
 (0)