X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/24a30f976686c4d183c1bd09cdae95c15a7b8dae..645219bfa68384dad930269b94e2ddf8b4cd3488:/apps/catalogue/models.py?ds=inline diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index 00baa287e..455296217 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -168,7 +168,7 @@ def book_upload_path(ext=None, maxlen=100): name = slughifi(filename.split(".")[0]) else: name = slughifi(media.name) - return 'lektura/%s.%s' % (name[:(maxlen-len('lektura/.%s' % ext))], ext) + return 'lektura/%s.%s' % (name[:maxlen-len('lektura/.%s' % ext)-4], ext) return get_dynamic_path @@ -558,7 +558,7 @@ class Book(models.Model): tag.save() book_tags.append(tag) - book.tags = book_tags + book_shelves + book.tags = set(book_tags + book_shelves) book_tag = book.book_tag()