fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updating stats.
[wolnelektury.git]
/
src
/
funding
/
models.py
diff --git
a/src/funding/models.py
b/src/funding/models.py
index
79385a2
..
289ec33
100644
(file)
--- a/
src/funding/models.py
+++ b/
src/funding/models.py
@@
-10,6
+10,7
@@
from django.db import models
from django.dispatch import receiver
from django.template.loader import render_to_string
from django.urls import reverse
from django.dispatch import receiver
from django.template.loader import render_to_string
from django.urls import reverse
+from django.utils.html import mark_safe
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _, override
import getpaid
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _, override
import getpaid
@@
-38,9
+39,8
@@
class Offer(models.Model):
notified_end = models.DateTimeField(_('End notifications sent'), blank=True, null=True)
def cover_img_tag(self):
notified_end = models.DateTimeField(_('End notifications sent'), blank=True, null=True)
def cover_img_tag(self):
- return
'<img src="%s" />' % self.cover.url
+ return
mark_safe('<img src="%s" />' % self.cover.url)
cover_img_tag.short_description = _('Cover preview')
cover_img_tag.short_description = _('Cover preview')
- cover_img_tag.allow_tags = True
class Meta:
verbose_name = _('offer')
class Meta:
verbose_name = _('offer')
@@
-304,6
+304,9
@@
class Funding(models.Model):
'key': self.notify_key,
}))
'key': self.notify_key,
}))
+ def wl_optout_url(self):
+ return 'https://wolnelektury.pl' + self.get_disable_notifications_url()
+
def save(self, *args, **kwargs):
if self.email and not self.notify_key:
self.notify_key = get_random_hash(self.email)
def save(self, *args, **kwargs):
if self.email and not self.notify_key:
self.notify_key = get_random_hash(self.email)