From 276c7e99016c6590ca648c16c091e0dabfaefa67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 9 Apr 2020 14:52:56 +0200 Subject: [PATCH] Set VM order starting date on creation --- uncloud_django_based/uncloud/uncloud_vm/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uncloud_django_based/uncloud/uncloud_vm/views.py b/uncloud_django_based/uncloud/uncloud_vm/views.py index e6bf1e2..a29ecd7 100644 --- a/uncloud_django_based/uncloud/uncloud_vm/views.py +++ b/uncloud_django_based/uncloud/uncloud_vm/views.py @@ -1,5 +1,6 @@ from django.db import transaction from django.shortcuts import render +from django.utils import timezone from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 @@ -118,7 +119,8 @@ class VMProductViewSet(ProductViewSet): # Create base order. order = Order.objects.create( recurring_period=order_recurring_period, - owner=request.user + owner=request.user, + starting_date=timezone.now() ) order.save()