Skip to content

Commit e740c50

Browse files
committed
spending_limit except for network issues. Warning message in the user FC account.
1 parent 541caa4 commit e740c50

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

valuenetwork/valueaccounting/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4516,7 +4516,7 @@ def spending_limit(self):
45164516
bal = balance #bal = Decimal(balance[0]) / FAIRCOIN_DIVISOR
45174517
fee = Decimal(network_fee()) / FAIRCOIN_DIVISOR
45184518
limit = bal - fee
4519-
except InvalidOperation:
4519+
except:
45204520
limit = Decimal("0.0")
45214521
return limit
45224522

work/templates/work/faircoin_account.html

+19-4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@
7878
</div>
7979
</legend>
8080

81+
{% if resource.digital_currency_balance == "Not accessible now" %}
82+
<div class="alert alert-warning">
83+
<strong>{% trans "Warning:" %}</strong>
84+
{% trans "Operations with your online wallet are not available temporarily. Please, come back later." %}
85+
</div>
86+
{% endif %}
87+
8188
{% if agent and request.user.agent.agent.is_staff %}
8289
<div class="modal hide fade" id="resourceChangeForm" tabindex="-1" role="dialog" aria-labelledby="resource-change-label" aria-hidden="true">
8390
<div class="modal-header">
@@ -126,10 +133,14 @@ <h3 id="resource-change-label">{% trans "Change" %} {{ resource }}</h3>
126133
<table class="table table-bordered" >
127134
<tr>
128135
<th style="text-align: right;">{% trans "Balance" %}</th>
129-
{% if not resource.digital_currency_balance = resource.digital_currency_balance_unconfirmed %}
130-
<td>{{ resource.digital_currency_balance }} (-> {{ resource.digital_currency_balance_unconfirmed }}) {{ resource.unit_of_quantity }}</td>
136+
{% if not resource.digital_currency_balance == "Not accessible now" %}
137+
{% if not resource.digital_currency_balance == resource.digital_currency_balance_unconfirmed %}
138+
<td>{{ resource.digital_currency_balance }} (-> {{ resource.digital_currency_balance_unconfirmed }}) {{ resource.unit_of_quantity }}</td>
139+
{% else %}
140+
<td>{{ resource.digital_currency_balance }} {{ resource.unit_of_quantity }}</td>
141+
{% endif %}
131142
{% else %}
132-
<td>{{ resource.digital_currency_balance }} {{ resource.unit_of_quantity }}</td>
143+
<td class="error"><b>{% trans "Not available now" %}</b></td>
133144
{% endif %}
134145
</tr>
135146
{% comment %}
@@ -264,7 +275,11 @@ <h3 id="coinHeader" >{% trans "Send Faircoins" %}</h3>
264275
{% else %}
265276
{% csrf_token %}
266277
{{ send_coins_form|as_bootstrap }}
267-
<button class="btn btn-primary" name="sendCoins" value="coins">{% trans "Send" %}</button>
278+
{% if not resource.digital_currency_balance == "Not accessible now" %}
279+
<button class="btn btn-primary" name="sendCoins" value="coins">{% trans "Send" %}</button>
280+
{% else %}
281+
<button class="btn btn-danger disabled" disabled><b>{% trans "Not available now" %}</b></button>
282+
{% endif %}
268283
{% endif %}
269284
</form>
270285
{% endif %}

0 commit comments

Comments
 (0)