Team membership expiration warnings sent before renewal is possible
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Guruprasad |
Bug Description
This morning, I received this email:
```
Date: Fri, 19 Aug 2022 05:15:55 -0000
From: Ubuntu IRC members <email address hidden>
To: Colin Watson <email address hidden>
Subject: Your membership in ubuntu-irc-members is about to expire
Hello Colin Watson,
On 2022-09-16, 4 weeks from now, your membership
in the Ubuntu IRC members (ubuntu-
<https:/
If you want, you can renew this membership at
<https:/
If your membership does expire, we'll send you one more message to let
you know it's happened.
Thanks for using Launchpad!
```
I followed the renewal link, which told me:
```
This membership cannot be renewed because it is not set to expire in 28 days or less. You or one of the team administrators has already renewed it.
```
Odd. What's going on?
Looking at the membership list for that team, my membership is set to expire at 2022-09-16 16:15:49Z, which is a little over 28 days from now, so I expect I'll be able to renew this later today. It looks like we have some kind of fencepost issue here.
The recent changes to expiring membership emails involved `Func("date_trunc", "day", TeamMembership.
I can think of a few ways to fix this:
1) Make sure the expiration warning is only sent if the expiry is strictly less than `DAYS_BEFORE_
2) Change the renewal logic to do similar day-truncation, so that we allow renewal if the day part of the expiration date is less than or equal to the current day plus `DAYS_BEFORE_
3) Just add a grace period of one day to the renewal logic to cover the fencepost error.
I don't think it's particularly important which we go for, so whatever's easiest.
Related branches
- Colin Watson (community): Approve
-
Diff: 88 lines (+43/-4)3 files modifiedlib/lp/registry/browser/team.py (+6/-2)
lib/lp/registry/doc/teammembership.rst (+32/-1)
lib/lp/registry/model/teammembership.py (+5/-1)
Changed in launchpad: | |
assignee: | nobody → Guruprasad (lgp171188) |
status: | Triaged → In Progress |
Changed in launchpad: | |
status: | In Progress → Fix Committed |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |