pinax / pinax-ratings

a ratings app for Django
MIT License
89 stars 28 forks source link

Fix TypeError when call str() on ratings #46

Closed michaelsteigman closed 6 years ago

michaelsteigman commented 6 years ago

Small Fixes following error:

TypeError: __str__ returned non-string (type int)

Generated (e.g.) when viewing objects a user has created.

grahamu commented 6 years ago

Thanks for the fix @michaelsteigman! How about adding a short test in tests/test_models.py which creates a Rating and then attempts to use that rating in a string, i.e. f"this rating is {rating}" and shows the failure? Thanks!

michaelsteigman commented 6 years ago

But of course!

kasulani commented 6 years ago

@grahamu i would like to take on this issue and write a test for it

grahamu commented 6 years ago

That would be great @kasulani, please add your test to test_models.py, thanks!

grahamu commented 6 years ago

@michaelsteigman this is fixed by virtue of https://github.com/pinax/pinax-ratings/pull/47/files#diff-0e60a6249923130e95b2aba91a93c39cR96. pinax-ratings v3.0.2 is available on PyPi https://pypi.python.org/pypi/pinax-ratings/3.0.2 with test coverage raised from 54% to 96% courtesy of @kasulani. Thanks for bringing this to our attention!