File: 0002-Fix-Remove-sociallogin.account-from-the-debug-print.patch

package info (click to toggle)
django-mailman3 1.3.15-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,544 kB
  • sloc: python: 2,186; makefile: 18; javascript: 14; sh: 7
file content (29 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: =?utf-8?q?Pierre-Elliott_B=C3=A9cue?= <peb@debian.org>
Date: Sun, 20 Oct 2024 16:49:47 +0200
Subject: Fix: Remove sociallogin.account from the debug print.

Forwarded: https://gitlab.com/mailman/django-mailman3/-/issues/82

Since SocialLogin.account isn't a mandatory field, we can't make and
assumption that it was filled in when it was created. Instead of
checking everytie if the attribute exists, removing it form the debug
print to restore compat with newer versions of django-allauth.
---
 django_mailman3/signals.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/django_mailman3/signals.py b/django_mailman3/signals.py
index e1d253a..adc6b95 100644
--- a/django_mailman3/signals.py
+++ b/django_mailman3/signals.py
@@ -171,8 +171,8 @@ def on_social_account_added(sender, **kwargs):
     # Add to mailman emails that were marked as verified by the social account
     # provider.
     sociallogin = kwargs["sociallogin"]
-    logger.debug("Social account %s added for user %s",
-                 sociallogin.account, sociallogin.user.username)
+    logger.debug("Social account added for user %s",
+                 sociallogin.user.username)
     for address in sociallogin.email_addresses:
         if EmailAddress.objects.filter(email=address.email).exists():
             # TODO: should we do something if it belongs so another user?