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

keywords_string not working on Product model #301

Closed
romecode opened this issue Jul 21, 2016 · 1 comment
Closed

keywords_string not working on Product model #301

romecode opened this issue Jul 21, 2016 · 1 comment
Labels

Comments

@romecode
Copy link

romecode commented Jul 21, 2016

Even though Product.keywords.all() will return assigned keywords, Product.keywords_string does not return the csv of keywords.

The problem lies here:
save_model is run first in the admin and the old version of Product instance is saved as self._product=obj
related_items_changed runs after for the KeywordField
then save_formset runs and saves the previous obj in self._product over the new

keywords_string are overwritten

fetching the Product in save_formset does indeed fix the issue, however, I am not sure if this is the best way to go about it
self._product=Product.objects.get(pk=self._product.pk)

@stephenmcd
Copy link
Owner

I've applied mostly the same fix you suggested in the linked Mezzanine issue.

Thanks for your help!

Repository owner deleted a comment from github-actions bot Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants