Commit 615de8f9 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

quotaholder: Explicitly set commission's issue_time

Avoid function call as a default value in model.
parent 0114e945
...@@ -164,7 +164,9 @@ def issue_commission(clientkey, provisions, name="", force=False): ...@@ -164,7 +164,9 @@ def issue_commission(clientkey, provisions, name="", force=False):
operations.revert() operations.revert()
raise raise
commission = Commission.objects.create(clientkey=clientkey, name=name) commission = Commission.objects.create(clientkey=clientkey,
name=name,
issue_time=now())
for (holder, source, resource), quantity in provisions_to_create: for (holder, source, resource), quantity in provisions_to_create:
Provision.objects.create(serial=commission, Provision.objects.create(serial=commission,
holder=holder, holder=holder,
......
...@@ -65,7 +65,7 @@ class Commission(Model): ...@@ -65,7 +65,7 @@ class Commission(Model):
serial = AutoField(primary_key=True) serial = AutoField(primary_key=True)
name = CharField(max_length=4096, default="") name = CharField(max_length=4096, default="")
clientkey = CharField(max_length=4096, null=False) clientkey = CharField(max_length=4096, null=False)
issue_time = CharField(max_length=24, default=now) issue_time = CharField(max_length=24)
objects = ForUpdateManager() objects = ForUpdateManager()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment