Fix update_nickname runs on ever save of userprofile, fix nickname not updated after main's name changes

This commit is contained in:
ErikKalkoken
2020-06-28 21:38:25 +02:00
parent 64b72d0b06
commit 5c7478fa39
5 changed files with 93 additions and 93 deletions

View File

@@ -68,7 +68,11 @@ class DiscordService(ServicesHook):
logger.debug('Syncing %s nickname for user %s', self.name, user)
if self.user_has_account(user):
tasks.update_nickname.apply_async(
kwargs={'user_pk': user.pk}, priority=SINGLE_TASK_PRIORITY
kwargs={
'user_pk': user.pk,
'nickname': DiscordUser.objects.user_formatted_nick(user)
},
priority=SINGLE_TASK_PRIORITY
)
def sync_nicknames_bulk(self, users: list):