From cd6e63bdb71976234482dd894c07dd0651036cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 10 Aug 2016 23:46:32 +0300 Subject: [PATCH] Don't require braintree to be always installed. Fixes #74 --- hc/payments/models.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hc/payments/models.py b/hc/payments/models.py index 45b095ca..97ab1c4c 100644 --- a/hc/payments/models.py +++ b/hc/payments/models.py @@ -1,8 +1,14 @@ -import braintree - +from django.conf import settings from django.contrib.auth.models import User from django.db import models +if settings.USE_PAYMENTS: + import braintree +else: + # hc.payments tests mock this object, so tests should + # still be able to run: + braintree = None + class SubscriptionManager(models.Manager):