From: Radek Czajka Date: Mon, 13 Jan 2020 10:00:42 +0000 (+0000) Subject: Fixes X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/0fe31ea9418a81ad0418d0cf91c988a959502e4f Fixes --- diff --git a/src/catalogue/urls.py b/src/catalogue/urls.py index 27fddc2f0..230e1c925 100644 --- a/src/catalogue/urls.py +++ b/src/catalogue/urls.py @@ -37,7 +37,7 @@ urlpatterns = [ path('audiobooki/', views.audiobooks, name='audiobook_list'), path('daisy/', views.daisy_list, name='daisy_list'), path('nowe/', ListView.as_view( - queryset=Book.objects.filter(parent=None).order_by('-created_at'), + queryset=Book.objects.filter(parent=None, findable=True).order_by('-created_at'), template_name='catalogue/recent_list.html'), name='recent_list'), path('nowe/audiobooki/', ListView.as_view( queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m'), diff --git a/src/club/management/commands/prolong.py b/src/club/management/commands/prolong.py index 34ebe63ad..2705990ee 100644 --- a/src/club/management/commands/prolong.py +++ b/src/club/management/commands/prolong.py @@ -2,6 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from datetime import timedelta +import traceback from django.core.management.base import BaseCommand, CommandError from django.utils.timezone import now from club.models import Schedule @@ -11,5 +12,9 @@ class Command(BaseCommand): def handle(self, *args, **options): for s in Schedule.objects.exclude(monthly=False, yearly=False).filter(is_cancelled=False, expires_at__lt=now() + timedelta(1)): print(s, s.email, s.expires_at) - s.pay(None) + try: + s.pay(None) + except: + traceback.print_exc() + diff --git a/src/club/payu/models.py b/src/club/payu/models.py index 1a49dd707..f7c35352d 100644 --- a/src/club/payu/models.py +++ b/src/club/payu/models.py @@ -124,6 +124,8 @@ class Order(models.Model): token.save() # else? + if 'orderId' not in response: + raise ValueError("Expecting dict with `orderId` key, got: %s" % response) self.order_id = response['orderId'] self.save() diff --git a/src/club/templates/club/email/thanks.txt b/src/club/templates/club/email/thanks.txt index 86e1e54c1..ffd83d00c 100644 --- a/src/club/templates/club/email/thanks.txt +++ b/src/club/templates/club/email/thanks.txt @@ -1,6 +1,6 @@ {% load chunks %}{% chunk "club_email_thanks" %} -Od {{ schedule.started_at.date }} wspierasz nas kwotą {{ schedule.amount }} zł {{ schedule.plan.get_interval_display }}. +W dniu {{ schedule.started_at.date }} wsparłeś/-aś nas kwotą {{ schedule.amount }} zł. {% if schedule.membership %} {% chunk "club_email_thanks_registered" %}