From fa684d694f5c7bdd915511d3e486ceaf076646af Mon Sep 17 00:00:00 2001
From: Christian Dresen <c.dresen@fh-muenster.de>
Date: Tue, 28 Mar 2017 22:54:31 +0200
Subject: [PATCH] [WarpPay] Fixed Cash paid

---
 www/web/warppay/views.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/web/warppay/views.py b/www/web/warppay/views.py
index b7a1da5..6ea282f 100644
--- a/www/web/warppay/views.py
+++ b/www/web/warppay/views.py
@@ -132,7 +132,8 @@ def transaction(request, user_id=None):
                 if 'cash_paid' in request.data:
                     t.cash_paid = bool(request.data['cash_paid'])
                 t.amount = product.price_vk
-                u.credit -= t.amount
+                if not t.cash_paid:
+                    u.credit -= t.amount
             except:
                 return Response(status=status.HTTP_406_NOT_ACCEPTABLE)
         else:
-- 
GitLab