Fix current membership is inactive future membership #3777
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #3776.
Summary
Before this, two things were done in an ugly/inaccurate way:
Member.current_membership
returned the latest membership, even if it hadn't begun yet.But before 0f6488a, we did not check for the
membership.since
date when checking if a membership is active. This meant that the above 2 things together gave the expected behaviour. So adding that check broke the expected but hacky behaviour.In this PR, I got rid of both weird things. Memberships normally start at the date they're completed (typically i.e. paid). For memberships completed in august, that means that the last few days/weeks of august are given 'for free' as they were before, but just also stored that way. And the
current_membership
property and friends now do what one would expect: return only current memberships.How to test