Fixes
authorRadek Czajka <rczajka@rczajka.pl>
Mon, 13 Jan 2020 10:00:42 +0000 (10:00 +0000)
committerRadek Czajka <rczajka@rczajka.pl>
Mon, 13 Jan 2020 10:00:42 +0000 (10:00 +0000)
src/catalogue/urls.py
src/club/management/commands/prolong.py
src/club/payu/models.py
src/club/templates/club/email/thanks.txt

index 27fddc2..230e1c9 100644 (file)
@@ -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'),
index 34ebe63..2705990 100644 (file)
@@ -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()
+
 
index 1a49dd7..f7c3535 100644 (file)
@@ -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()
 
index 86e1e54..ffd83d0 100644 (file)
@@ -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" %}