Membership drops the TimeStamped ordering its siblings keep
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with accounts/models.py around line 83 and compare Membership.Meta with abstract/models.py lines 31-34, then inspect callers of Membership querysets for ordering assumptions. Done means Membership has the same timestamp ordering and latest behavior as its sibling TimeStamped models, with affected callers checked.
Written by the indexing model from the issue text.
Description
Membership drops the ordering that every other TimeStamped model keeps. Membership.objects.latest() raises as a result.
Work reference: branch codingjoe-weekly-digest, commits 2ace45d2 to 6f28eacf, weekly sending digest (superJoe crew, out of scope for that change).
side quest:accounts.models.Membership.Meta does not inherit TimeStamped.Meta, so Membership silently drops the modified_at/created_at ordering and get_latest_by that every sibling model keeps. [accounts/models.py]:L83
abstract.models.TimeStamped.Meta sets ordering = ("-modified_at", "-created_at") and get_latest_by = "created_at" (abstract/models.py:31-34). Membership.Meta declares only the unique constraint. The model therefore has no default ordering, while every other TimeStamped child inherits one. Membership.objects.latest() raises.
The change is one line, but it alters the ordering of any unordered membership queryset. It needs a check of its callers, not a drive-by fix.
- Dominant language
- Python
- Stars
- 4
- Forks
- 0
- Avg merge
- 2h 40m
- Merged PRs (30d)
- 163
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from codingjoe/relay
-
enhancement real sec
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
codingjoe/relay#410 · 1 comment ·
Maintainers usually reply within 1 day
-
bug side quest
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
bug side quest
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
side quest test
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
side quest test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#4115 ·
-
get_lldp_neighbors_detail: query asks for 'max-address' (typo for 'mac-address'), so remote_chassis_id is always emptyPossibly taken @Jah-yee claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
lesson-submission pending-review
Difficulty 1/5 Under an hour Newbie friendliness 74/100
Ikalus1988/MisakaNet#3899 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aws-samples/sample-per-model-bedrock#549 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100