resolve conflicts
This commit is contained in:
commit
2a7603778a
60 changed files with 676 additions and 444 deletions
|
|
@ -29,10 +29,11 @@ class DjangoHostingView(ProcessVMSelectionMixin, View):
|
|||
'email': "info@django-hosting.ch",
|
||||
'vm_types': VirtualMachineType.get_serialized_vm_types(),
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
||||
request.session['hosting_url'] = reverse('hosting:djangohosting')
|
||||
context = self.get_context_data()
|
||||
|
||||
return render(request, self.template_name, context)
|
||||
|
|
@ -53,6 +54,7 @@ class RailsHostingView(ProcessVMSelectionMixin, View):
|
|||
return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
request.session['hosting_url'] = reverse('hosting:railshosting')
|
||||
context = self.get_context_data()
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
|
@ -72,7 +74,7 @@ class NodeJSHostingView(ProcessVMSelectionMixin, View):
|
|||
return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
||||
request.session['hosting_url'] = reverse('hosting:nodejshosting')
|
||||
context = self.get_context_data()
|
||||
|
||||
return render(request, self.template_name, context)
|
||||
|
|
@ -143,8 +145,9 @@ class SignupView(CreateView):
|
|||
return HttpResponseRedirect(self.get_success_url())
|
||||
|
||||
|
||||
class PaymentVMView(FormView):
|
||||
class PaymentVMView(LoginRequiredMixin, FormView):
|
||||
template_name = 'hosting/payment.html'
|
||||
login_url = reverse_lazy('hosting:login')
|
||||
form_class = BillingAddressForm
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
|
@ -183,7 +186,7 @@ class PaymentVMView(FormView):
|
|||
billing_address = form.save()
|
||||
|
||||
# Create a Hosting Order
|
||||
order = HostingOrder.create(VMPlan=plan, customer=customer,
|
||||
order = HostingOrder.create(vm_plan=plan, customer=customer,
|
||||
billing_address=billing_address)
|
||||
|
||||
# Make stripe charge to a customer
|
||||
|
|
@ -219,6 +222,7 @@ class PaymentVMView(FormView):
|
|||
|
||||
class OrdersHostingDetailView(LoginRequiredMixin, DetailView):
|
||||
template_name = "hosting/order_detail.html"
|
||||
context_object_name = "order"
|
||||
login_url = reverse_lazy('hosting:login')
|
||||
model = HostingOrder
|
||||
|
||||
|
|
@ -229,6 +233,7 @@ class OrdersHostingListView(LoginRequiredMixin, ListView):
|
|||
context_object_name = "orders"
|
||||
model = HostingOrder
|
||||
paginate_by = 10
|
||||
ordering = '-id'
|
||||
|
||||
def get_queryset(self):
|
||||
user = self.request.user
|
||||
|
|
@ -250,6 +255,7 @@ class VirtualMachinesPlanListView(LoginRequiredMixin, ListView):
|
|||
context_object_name = "vms"
|
||||
model = VirtualMachinePlan
|
||||
paginate_by = 10
|
||||
ordering = '-id'
|
||||
|
||||
def get_queryset(self):
|
||||
user = self.request.user
|
||||
|
|
@ -257,7 +263,7 @@ class VirtualMachinesPlanListView(LoginRequiredMixin, ListView):
|
|||
return super(VirtualMachinesPlanListView, self).get_queryset()
|
||||
|
||||
|
||||
class VirtualMachineDetailListView(LoginRequiredMixin, DetailView):
|
||||
class VirtualMachineDetailView(LoginRequiredMixin, DetailView):
|
||||
template_name = "hosting/virtual_machine_detail.html"
|
||||
login_url = reverse_lazy('hosting:login')
|
||||
model = VirtualMachinePlan
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue