Set VM order starting date on creation

This commit is contained in:
fnux 2020-04-09 14:52:56 +02:00
parent 3a37343a73
commit 276c7e9901

View file

@ -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()