Send user-modified only to webhooks of relevant OAuth apps #93585
@ -143,11 +143,13 @@ def handle_modifications(sender, user: UserModel, **kwargs):
|
||||
log.debug("User changed email from %s to %s", old_email, user.email)
|
||||
user_email_changed.send(sender, user=user, old_email=old_email)
|
||||
|
||||
hooks = models.Webhook.objects.filter(enabled=True).filter(
|
||||
app__in=user.bid_main_oauth2accesstoken.distinct().values_list('application', flat=True)
|
||||
hooks = list(
|
||||
models.Webhook.objects.filter(enabled=True).filter(
|
||||
app__in=user.bid_main_oauth2accesstoken.distinct().values_list('application', flat=True)
|
||||
)
|
||||
)
|
||||
|
||||
hooks_count = hooks.count()
|
||||
hooks_count = len(hooks)
|
||||
if hooks_count == 0:
|
||||
log.info('Not sending modification of pk=%d to any webhooks', user.pk)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user