From a16dbb50d8e1f9b2705c9f91bfa0b0d881046d86 Mon Sep 17 00:00:00 2001
From: Arvind Tiwari
- {{request.session.user.email}}
+ {% if request.user.is_authenticated %}
+ {{request.user.email}}
+ {% else %}
+ {{request.session.user.email}}
+ {% endif %}
{% endif %}
{% trans "Cores" %} - {{vm.cores}} + {{vm.cores|floatformat}}
{% trans "Memory" %} @@ -140,10 +144,10 @@ {% endif %} +{% if order %}
-{% if order %} {% endif %} {% if not order %} diff --git a/hosting/urls.py b/hosting/urls.py index bc14c3a6..a946fee1 100644 --- a/hosting/urls.py +++ b/hosting/urls.py @@ -12,7 +12,7 @@ from .views import ( from django.views.generic import TemplateView urlpatterns = [ - url(r'test/?$', TemplateView.as_view(template_name='hosting/order_detail.html')), + url(r'test/?$', TemplateView.as_view(template_name='hosting/order_detail.html'), name='test'), url(r'index/?$', IndexView.as_view(), name='index'), url(r'django/?$', DjangoHostingView.as_view(), name='djangohosting'), url(r'dashboard/?$', DashboardView.as_view(), name='dashboard'), diff --git a/hosting/views.py b/hosting/views.py index 0458464d..95304212 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -661,7 +661,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, self.request.session.get('token') ) else: - card_details = None + card_details = {} if self.request.GET.get('page') == 'payment': context['page_header_text'] = _('Confirm Order') @@ -704,12 +704,12 @@ class OrdersHostingDetailView(LoginRequiredMixin, return context def get(self, request, *args, **kwargs): - # if 'specs' not in self.request.session: - # return HttpResponseRedirect( - # reverse('hosting:create_virtual_machine') - # ) - # if 'token' not in self.request.session: - # return HttpResponseRedirect(reverse('hosting:payment')) + if 'specs' not in self.request.session: + return HttpResponseRedirect( + reverse('hosting:create_virtual_machine') + ) + if 'token' not in self.request.session: + return HttpResponseRedirect(reverse('hosting:payment')) self.object = self.get_object() context = self.get_context_data(object=self.object) if 'failed_payment' in context: