~sircmpwn/sr.ht-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH lists.sr.ht] lists.sr.ht-process: unsubscribe by email, too

Details
Message ID
<20240729091431.48579-1-ch@bitfehler.net>
DKIM signature
pass
Download raw message
Patch: +4 -0
In some circumstances, when a user subscribed to a list before creating
an account for the same email address, it can be impossible for the user
to unsubscribe from a list, because the unsubscribe code path only
checks for subscriptions for the user's ID, not the user's email.

This commit makes the unsubscribe code path look for subscriptions for
the user's email as well, if none were found for the ID. While this does
not fix the root cause (doing so is a bit more involved), it does allow
users who are in this situation to successfully unsubscribe.
---
 listssrht/process.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/listssrht/process.py b/listssrht/process.py
index 2e877dd..64bd2fa 100644
--- a/listssrht/process.py
+++ b/listssrht/process.py
@@ -472,6 +472,10 @@ def _unsubscribe(dest, mail):
        sub = Subscription.query.filter(
            Subscription.list_id == dest.id,
            Subscription.user_id == user.id).one_or_none()
        if sub is None:
            sub = Subscription.query.filter(
                Subscription.list_id == dest.id,
                Subscription.email == user.email).one_or_none()
    else:
        sub = Subscription.query.filter(
            Subscription.list_id == dest.id,
-- 
2.45.2

[lists.sr.ht/patches/alpine.yml] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D31WQU6BSY1E.1QVDBGWHW7K0D@fra01>
In-Reply-To
<20240729091431.48579-1-ch@bitfehler.net> (view parent)
DKIM signature
missing
Download raw message
lists.sr.ht/patches/alpine.yml: FAILED in 1m25s

[lists.sr.ht-process: unsubscribe by email, too][0] from [Conrad Hoffmann][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/54154
[1]: ch@bitfehler.net

✗ #1288218 FAILED lists.sr.ht/patches/alpine.yml https://builds.sr.ht/~sircmpwn/job/1288218
Details
Message ID
<D3Y7AUFJDQUZ.1I80KH6V6XIQL@cmpwn.com>
In-Reply-To
<20240729091431.48579-1-ch@bitfehler.net> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/lists.sr.ht
   d1c5f3a..e1ae776  master -> master
Reply to thread Export thread (mbox)