X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5a605e04abaa18a80e391c5cc26c48e0125d6f3c..c028a70a6130acfe7e86f37f1a9f2e6b36a26194:/apps/catalogue/utils.py 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):