forked from GithubBackups/healthchecks
Don't try to import braintree if USE_PAYMENTS=False. Fixes #28
This commit is contained in:
parent
7f2aa9e97c
commit
6945497b37
@ -1,4 +1,4 @@
|
||||
import braintree
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import (HttpResponseBadRequest, HttpResponseForbidden,
|
||||
@ -9,6 +9,13 @@ from hc.accounts.models import Profile
|
||||
|
||||
from .models import Subscription
|
||||
|
||||
if settings.USE_PAYMENTS:
|
||||
import braintree
|
||||
else:
|
||||
# hc.payments tests mock this object, so tests should
|
||||
# still be able to run:
|
||||
braintree = None
|
||||
|
||||
|
||||
@login_required
|
||||
def get_client_token(request):
|
||||
|
Loading…
x
Reference in New Issue
Block a user