Commit 8cd1e17a authored by Birin Sanchez's avatar Birin Sanchez

Don't show "Complete Billing" in pending page if customer has an

ExternalCredit, which means he/she has a subscription.
Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent e11a0807
......@@ -31,11 +31,13 @@ SPDX-License-Identifier: AGPL-3.0
<p>
Your registration is pending. If you completed the billing process, please wait two minutes before refreshing this page.
</p>
{% if not haspaid %}
<p>If you have <strong><i>not</i></strong> completed the billing process, <a href="{{complete_signup_url}}">please do so now.</a>
</p>
<p>
Pending registrations are removed after 24 hours.
</p>
{% endif %}
</div>
{% else %}
<p>{% trans "Service credit and profile management" %}</p>
......
......@@ -4,7 +4,7 @@ from django.http import FileResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from .models import Limit
from .models import Limit, ExternalCredit
from invitation.models import Invitation
from purist.models import AccountType
from cart.views import CartRegistrationView
......@@ -52,7 +52,9 @@ def userlimit(request):
if not inv.expired() and not inv.consumed:
invitations['links_not_used'] = True
invitations['list'].append(inv_dict)
ec = ExternalCredit.objects.filter(
account_name=request.user.get_identity())
haspaid = len(ec) > 0
render_data = {
"DEBUG_CHANGE_PASSWORD": settings.DEBUG_CHANGE_PASSWORD,
"username": username,
......@@ -67,6 +69,7 @@ def userlimit(request):
"invitations": invitations,
"haschosenreward": hasattr(request.user, 'chosenreward'),
"complete_signup_url": CartRegistrationView().get_success_url(request.user),
"haspaid": haspaid,
}
return render(request, 'limitmonitor/userlimit.html', render_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment