From 4c127cd41e2967234a831c16ca3a82fe852358d0 Mon Sep 17 00:00:00 2001 From: Mike Hennessy Date: Thu, 9 Sep 2021 09:26:51 -0400 Subject: [PATCH] Use the correct db object for last active --- seraphsix/tasks/activity.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seraphsix/tasks/activity.py b/seraphsix/tasks/activity.py index 82cab14..1ffce8e 100644 --- a/seraphsix/tasks/activity.py +++ b/seraphsix/tasks/activity.py @@ -102,10 +102,10 @@ async def get_last_active(ctx, member_db=None, platform_id=None, member_id=None) async def save_last_active(ctx, member_id): - member_db = await Member.get(id=member_id) - last_active = await get_last_active(ctx, member_db) - member_db.last_active = last_active - await member_db.save() + clanmember_db = await ClanMember.get(member__id=member_id).prefetch_related("member") + last_active = await get_last_active(ctx, clanmember_db.member) + clanmember_db.last_active = last_active + await clanmember_db.save() async def store_last_active(ctx, guild_id, guild_name):