except AttributeError:
PROJECT = 'Wolne Lektury'
-try:
- LICENSE = settings.ARCHIVE_LICENSE
-except AttributeError:
- LICENSE = 'http://creativecommons.org/licenses/by-sa/3.0/deed.pl'
+
+LICENSE = getattr(
+ settings,
+ 'ARCHIVE_LICENSE',
+ 'http://artlibre.org/licence/lal/pl/'
+)
+
+LICENSE_NAME = getattr(
+ settings, 'ARCHIVE_LICENSE_NAME',
+ 'Licencja Wolnej Sztuki 1.3'
+)
+
try:
ORGANIZATION = settings.ARCHIVE_ORGANIZATION
import io
from os import unlink
from tempfile import NamedTemporaryFile
+from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.template import Template, Context
verbose_name_plural = _("YouTube configurations")
def get_context(self, audiobook):
- return Context(dict(audiobook=audiobook))
+ return Context(dict(
+ audiobook=audiobook,
+ LICENSE=settings.LICENSE,
+ LICENSE_NAME=settings.LICENSE_NAME,
+ ))
def get_description(self, audiobook):
return Template(self.description_template).render(self.get_context(audiobook))