X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6535d2e28106edd90589a6a2376cf52a796adf3e..f16fb0040e6beb395ffea1ac252658ab0b8ac3f7:/src/club/payment_methods.py?ds=inline

diff --git a/src/club/payment_methods.py b/src/club/payment_methods.py
index 8d1ad7be9..4a596e45b 100644
--- a/src/club/payment_methods.py
+++ b/src/club/payment_methods.py
@@ -150,13 +150,16 @@ class PayPal(PaymentMethod):
     is_onetime = False
 
     def invite_widget(self, schedule, request):
-        return render_to_string(
-            'club/payment/paypal_invite.html',
-            {
-                'schedule': schedule,
-            },
-            request=request
-        )
+        if settings.PAYPAL_ENABLED:
+            return render_to_string(
+                'club/payment/paypal_invite.html',
+                {
+                    'schedule': schedule,
+                },
+                request=request
+            )
+        else:
+            return ''
     
     def initiate(self, request, schedule):
         app = request.GET.get('app')