Skip to content

Commit ecef61c

Browse files
authored
Merge pull request #911 from maanijou/fix-cannot-set-persian-titles-bookcover
Fix using persian/arabic titles for book covers meta
2 parents 33b4949 + 7ba872b commit ecef61c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/booki/editor/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# along with Booktype. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import json
18+
import unidecode
1819

1920
from django.shortcuts import render_to_response, render
2021
from django.core.paginator import Paginator, InvalidPage, EmptyPage
@@ -371,7 +372,7 @@ def upload_cover(request, bookid, version=None):
371372
import hashlib
372373

373374
h = hashlib.sha1()
374-
h.update(name)
375+
h.update(unidecode.unidecode(name))
375376
h.update(request.POST.get('format', ''))
376377
h.update(request.POST.get('license', ''))
377378
h.update(str(datetime.datetime.now()))

lib/booktype/apps/edit/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def upload_cover(request, bookid, version=None):
147147

148148
h = hashlib.sha1()
149149
h.update(filename)
150-
h.update(title)
150+
h.update(unidecode.unidecode(title))
151151
h.update(str(datetime.datetime.now()))
152152

153153
license = models.License.objects.get(

0 commit comments

Comments
 (0)