X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5767a4cec1018349191a60406a82b6a4d2ae431a..ed79e41001ebd01207fcea50e09aea5ebcae8a0d:/src/catalogue/models/book.py?ds=sidebyside diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 3811bbac1..d3e2a7756 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -153,6 +153,9 @@ class Book(models.Model): def language_name(self): return dict(settings.LANGUAGES).get(self.language_code(), "") + def is_foreign(self): + return self.language_code() != settings.LANGUAGE_CODE + def has_media(self, type_): if type_ in Book.formats: return bool(getattr(self, "%s_file" % type_))