X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/24a30f976686c4d183c1bd09cdae95c15a7b8dae..fab2510d92afec657693cdf6887ad9cee8376499:/apps/catalogue/models.py diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index 00baa287e..f2be7d1b9 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