Skip to content

Commit

Permalink
Actually use a user's iNat home server defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
synrg committed Aug 11, 2024
1 parent 0b48764 commit 6d0dd9c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions inatcog/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,16 @@ async def get_dronefly_user_config(
- the Dronefly user is not known either globally or in the guild scope
(i.e. anywhere=False vs. True)
"""
_user = user or ctx.author
try:
user_config = await get_valid_user_config(ctx, user or ctx.author, anywhere)
user_config = await get_valid_user_config(ctx, _user, anywhere)
user_config_dict = await user_config.all()
except LookupError:
user_config_dict = None
guild = ctx.guild or user_config_dict.get("server")
global_config = ctx.config
guild_config = ctx.config.guild(guild) if guild else None
cog = get_cog(ctx)
guild = ctx.guild or await get_home_server(cog, _user)
global_config = cog.config
guild_config = cog.config.guild(guild) if guild else None

dronefly_config = {}
for cog_key, core_key in COG_TO_CORE_USER_KEY.items():
Expand Down

0 comments on commit 6d0dd9c

Please sign in to comment.