Set license constants.
[audio.git] / src / youtube / models.py
index 576bf49..1a3fd01 100644 (file)
@@ -1,6 +1,7 @@
 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
@@ -42,7 +43,11 @@ class YouTube(models.Model):
         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))