Skip to content

Commit

Permalink
added alert message if coupon has expired
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Jun 3, 2019
1 parent 20a09b7 commit 5cb4696
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/dashboard/templates/bounty/fund.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ <h5 class="text-uppercase h3 font-weight-bold mb-0">{% trans "Total"%}</h5>

<script>
document.FEE_PERCENTAGE = {{ FEE_PERCENTAGE }};
{% if expired_coupon %}
_alert({ message: 'This coupon has expired.' }, 'error');
{% endif %}
</script>

<script src="{% static "v2/js/pages/wallet_estimate.js" %}"></script>
Expand Down
2 changes: 2 additions & 0 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2473,6 +2473,8 @@ def new_bounty(request):
if coupon.expiry_date > datetime.now().date():
params['FEE_PERCENTAGE'] = coupon.fee_percentage
params['coupon_code'] = coupon.code
else:
params['expired_coupon'] = True

print(params['FEE_PERCENTAGE'])

Expand Down

0 comments on commit 5cb4696

Please sign in to comment.