X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/67f5a03a4014feed95edf75d165f3cd669041426..a5d0aab8bef13d4fd4ea19c6b08d703453f3f47d:/apps/funding/models.py?ds=inline diff --git a/apps/funding/models.py b/apps/funding/models.py index 0bd5360f9..ba1494753 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -12,7 +12,7 @@ from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext, override import getpaid from catalogue.models import Book -from catalogue.utils import get_random_hash +from catalogue.utils import get_random_hash, related_tag_name from polls.models import Poll from django.contrib.sites.models import Site from . import app_settings @@ -175,7 +175,7 @@ class Offer(models.Model): 'funding/email/published.txt', { 'offer': self, 'book': self.book, - 'author': ", ".join(a[0] for a in self.book.related_info()['tags']['author']), + 'author': ", ".join(related_tag_name(a) for a in self.book.related_info()['tags']['author']), 'current': self.current(), }) @@ -233,6 +233,9 @@ class Funding(models.Model): def get_absolute_url(self): return reverse('funding_funding', args=[self.pk]) + def perk_names(self): + return ", ".join(perk.name for perk in self.perks.all()) + def get_disable_notifications_url(self): return "%s?%s" % (reverse("funding_disable_notifications"), urlencode({