From 69f523a398febde90b70efd8d74015c815ef9dbd Mon Sep 17 00:00:00 2001 From: Alice Date: Sat, 16 Sep 2017 12:23:31 +0200 Subject: [PATCH] Use new dynamic settings in bitcoin backend --- payments/backends/bitcoin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/payments/backends/bitcoin.py b/payments/backends/bitcoin.py index aa17f67..5fb17b4 100644 --- a/payments/backends/bitcoin.py +++ b/payments/backends/bitcoin.py @@ -3,6 +3,7 @@ from decimal import Decimal from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse +from constance import config as site_config from .base import BackendBase @@ -21,7 +22,6 @@ class BitcoinBackend(BackendBase): from bitcoin import SelectParams from bitcoin.rpc import Proxy - self.btc_value = settings.get('BITCOIN_VALUE') self.account = settings.get('ACCOUNT', 'ccvpn3') chain = settings.get('CHAIN') @@ -32,12 +32,14 @@ class BitcoinBackend(BackendBase): if not self.url: return - assert isinstance(self.btc_value, int) - self.make_rpc = lambda: Proxy(self.url) self.rpc = self.make_rpc() self.backend_enabled = True + @property + def btc_value(self): + return site_config.BTC_EUR_VALUE + def new_payment(self, payment): rpc = self.make_rpc()