Skip to content
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

Reset Inheritance broken #1857

Closed
vabene1111 opened this issue Jun 6, 2022 · 2 comments
Closed

Reset Inheritance broken #1857

vabene1111 opened this issue Jun 6, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@vabene1111
Copy link
Collaborator

Food reset inheritance function is broken

  File "F:\Developement\Django\recipes\cookbook\models.py", line 596, in reset_inheritance
    Through = Food.objects.filter(tree_filter).first().inherit_fields.through
AttributeError: 'NoneType' object has no attribute 'inherit_fields'

@vabene1111 vabene1111 added the bug Something isn't working label Jun 6, 2022
@Jbonnett
Copy link
Contributor

Just trying to find some low hanging fruit to wet my feet, so correct me if I am wrong.

Could this be caused by a space having no foods and hence the list returned by filter containing nothing, so first returns none. In that case is there food objects to reset at all? Couldn't the function just be a big null op at that point? Though at that point how/why was the function called?

Do you remember any of the context of this crash?

If this isn't a bug you want help with, is there some stuff you could use help with?

@vabene1111
Copy link
Collaborator Author

if you want feel free to give it a crack, i am sure that it isn't to hard i just did not have time to read/understand the 10 or so lines of code in that function. Your theory could be correct so reproducing should be easy, thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants