Skip to content

Handled pre-releases when setting previous release as end of life.#2018

Merged
bmispelon merged 1 commit intodjango:mainfrom
sarahboyce:eol_previous_release
Apr 17, 2025
Merged

Handled pre-releases when setting previous release as end of life.#2018
bmispelon merged 1 commit intodjango:mainfrom
sarahboyce:eol_previous_release

Conversation

@sarahboyce
Copy link
Copy Markdown
Contributor

Fixes #2016

@sarahboyce sarahboyce force-pushed the eol_previous_release branch from 72bb322 to aa9e38c Compare April 4, 2025 13:53
Copy link
Copy Markdown
Member

@bmispelon bmispelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this! The code is easy to read and the added tests show that it's working as intended.

I just left a suggestion, but that's for something that was already in the original code. I figure since we're touching it we may as well tidy up as we go 🧹

Nice work! 🎸

Comment thread releases/models.py
elif self.status == "f" and self.micro > 0:
previous_release_kwargs["micro"] = self.micro - 1

self.__class__.objects.filter(**previous_release_kwargs).update(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we can't use the simpler form:

Suggested change
self.__class__.objects.filter(**previous_release_kwargs).update(
self.filter(**previous_release_kwargs).update(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self here is a model instance I believe so you can't access filter or objects

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh 🤦🏻 (for some reason I thought we were on the queryset, not the model)

@bmispelon bmispelon merged commit 283b7c0 into django:main Apr 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Release.save() eol_date logic to handle pre-releases

2 participants