X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/24a30f976686c4d183c1bd09cdae95c15a7b8dae..bf8b3154e3a3d09be0d30516bf42a4652bcdedc8:/apps/catalogue/models.py?ds=sidebyside 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