Merge pull request #363 from pcoder/new_flow_enhancement

Fixed logo in payment/order confirmation page not redirecting to inde…
This commit is contained in:
Pcoder 2017-07-01 01:16:11 +02:00 committed by GitHub
commit d8786c9a3c
2 changed files with 5 additions and 3 deletions

View file

@ -204,7 +204,7 @@ class IndexView(CreateView):
manager = OpenNebulaManager() manager = OpenNebulaManager()
templates = manager.get_templates() templates = manager.get_templates()
context = { context = {
'templates': VirtualMachineTemplateSerializer(templates, many=True).data, 'templates': VirtualMachineTemplateSerializer(templates, many=True).data
} }
except: except:
messages.error( request, messages.error( request,
@ -330,7 +330,8 @@ class PaymentOrderView(FormView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(PaymentOrderView, self).get_context_data(**kwargs) context = super(PaymentOrderView, self).get_context_data(**kwargs)
context.update({ context.update({
'stripe_key': settings.STRIPE_API_PUBLIC_KEY 'stripe_key': settings.STRIPE_API_PUBLIC_KEY,
'site_url': reverse('datacenterlight:index')
}) })
return context return context
@ -393,6 +394,7 @@ class OrderConfirmationView(DetailView):
stripe_utils = StripeUtils() stripe_utils = StripeUtils()
card_details = stripe_utils.get_card_details(customer.stripe_id, request.session.get('token')) card_details = stripe_utils.get_card_details(customer.stripe_id, request.session.get('token'))
context = { context = {
'site_url': reverse('datacenterlight:index'),
'cc_last4' : card_details.get('response_object').get('last4'), 'cc_last4' : card_details.get('response_object').get('last4'),
'cc_brand' : card_details.get('response_object').get('brand') 'cc_brand' : card_details.get('response_object').get('brand')
} }

View file

@ -57,7 +57,7 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a class="navbar-brand topnav" href="{{ request.session.hosting_url}}"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a> <a class="navbar-brand topnav" href="{% if site_url %}{{site_url}}{% else %}{{ request.session.hosting_url}}{% endif %}"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
</div> </div>
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}
<!-- Collect the nav links, forms, and other content for toggling --> <!-- Collect the nav links, forms, and other content for toggling -->