X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5a605e04abaa18a80e391c5cc26c48e0125d6f3c..49e2be0521e11928d5f00378907e478d1bd703a4:/apps/catalogue/utils.py?ds=sidebyside diff --git a/apps/catalogue/utils.py b/apps/catalogue/utils.py index 3ffe9c0f6..acbd778cd 100644 --- a/apps/catalogue/utils.py +++ b/apps/catalogue/utils.py @@ -66,11 +66,12 @@ class ORMDocProvider(DocProvider): def __init__(self, book): self.book = book - def by_slug(self, slug): - if slug == self.book.slug: - return self.book.xml_file + def by_slug_and_lang(self, slug, language): + if slug == self.book.slug and language == self.language: + return open(self.book.xml_file.path) else: - return type(self.book).objects.get(slug=slug).xml_file + return type(self.book).objects.get( + slug=slug, language=language).xml_file class LockFile(object):