-
-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move ratings and reviews when switching editions #3117
Move ratings and reviews when switching editions #3117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my first contribution to Bookwyrm and, more importantly, my first time looking at Django and pytest. I am not (yet) a python person.
Welcome! And thanks for contributing. I'm a fairly new contributor myself, and interacting with the community has been a pleasure so far. <3
The code and tests are pretty simple but something is not making sense.
Ah, I cloned your PR and then followed your steps... (behaved as you described), then started reading about the models a bit and noticed...
However, if I remove the new code for ratings or just the
rating.book = new_edition
line, the new test for ratings still passes. I feel crazy.
... I believe this weird behavior could be accounted for by the fact that ReviewRating inherits from Review, and hence the loop over Review.objects
would cover ReviewRating as well?
ReviewRatings are a subclass and are included in the models.Review block
…n-switching-editions
…thub.com:mattlehrer/bookwyrm into move-ratings-and-reviews-when-switching-editions
I fixed the lint problems, sorry! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi again!
Apologies for the incredible delay. I sat down to re-review and test this, and everything looks good. I'm going to trigger a re-run of the tests against the latest main, and merge once they pass.
Thanks again for your contribution!
Fixes #2926
This is my first contribution to Bookwyrm and, more importantly, my first time looking at Django and pytest. I am not (yet) a python person. The code and tests are pretty simple but something is not making sense.
Most importantly, the ratings and reviews do move to the new edition in manual testing. If I comment out the for loop or just the line
readthrough.book = new_edition
then the associated test fails. Same forreview.book = new_edition
and my new test for reviews. All good so far. However, if I remove the new code for ratings or just therating.book = new_edition
line, the new test for ratings still passes. I feel crazy.I hope this is at least a step in the right direction. Thanks!