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 ...@@ -31,11 +31,13 @@ SPDX-License-Identifier: AGPL-3.0
<p> <p>
Your registration is pending. If you completed the billing process, please wait two minutes before refreshing this page. Your registration is pending. If you completed the billing process, please wait two minutes before refreshing this page.
</p> </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>If you have <strong><i>not</i></strong> completed the billing process, <a href="{{complete_signup_url}}">please do so now.</a>
</p> </p>
<p> <p>
Pending registrations are removed after 24 hours. Pending registrations are removed after 24 hours.
</p> </p>
{% endif %}
</div> </div>
{% else %} {% else %}
<p>{% trans "Service credit and profile management" %}</p> <p>{% trans "Service credit and profile management" %}</p>
......
...@@ -4,7 +4,7 @@ from django.http import FileResponse, HttpResponseRedirect ...@@ -4,7 +4,7 @@ from django.http import FileResponse, HttpResponseRedirect
from django.shortcuts import render from django.shortcuts import render
from django.urls import reverse from django.urls import reverse
from .models import Limit from .models import Limit, ExternalCredit
from invitation.models import Invitation from invitation.models import Invitation
from purist.models import AccountType from purist.models import AccountType
from cart.views import CartRegistrationView from cart.views import CartRegistrationView
...@@ -52,7 +52,9 @@ def userlimit(request): ...@@ -52,7 +52,9 @@ def userlimit(request):
if not inv.expired() and not inv.consumed: if not inv.expired() and not inv.consumed:
invitations['links_not_used'] = True invitations['links_not_used'] = True
invitations['list'].append(inv_dict) invitations['list'].append(inv_dict)
ec = ExternalCredit.objects.filter(
account_name=request.user.get_identity())
haspaid = len(ec) > 0
render_data = { render_data = {
"DEBUG_CHANGE_PASSWORD": settings.DEBUG_CHANGE_PASSWORD, "DEBUG_CHANGE_PASSWORD": settings.DEBUG_CHANGE_PASSWORD,
"username": username, "username": username,
...@@ -67,6 +69,7 @@ def userlimit(request): ...@@ -67,6 +69,7 @@ def userlimit(request):
"invitations": invitations, "invitations": invitations,
"haschosenreward": hasattr(request.user, 'chosenreward'), "haschosenreward": hasattr(request.user, 'chosenreward'),
"complete_signup_url": CartRegistrationView().get_success_url(request.user), "complete_signup_url": CartRegistrationView().get_success_url(request.user),
"haspaid": haspaid,
} }
return render(request, 'limitmonitor/userlimit.html', render_data) 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