[FIX] rating: correctly encode base64 image
Fixed a typo from commit 3824b5dcc1
This commit is contained in:
committed by
Jérome Maes
parent
ae2a64ab63
commit
a8f1adc29a
@@ -69,7 +69,7 @@ class Rating(models.Model):
|
||||
for rating in self:
|
||||
try:
|
||||
image_path = get_resource_path('rating', 'static/src/img', 'rating_%s.png' % (int(rating.rating),))
|
||||
rating.rating_image = base64.b64decode(open(image_path, 'rb').read())
|
||||
rating.rating_image = base64.b64encode(open(image_path, 'rb').read())
|
||||
except (IOError, OSError):
|
||||
rating.rating_image = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user