Commit 48d55f62 by Bach Dániel

Merge branch 'issue-196' into 'master'

Issue 196
parents f1075d52 9703cb54
...@@ -836,7 +836,8 @@ class VmRenewView(FormOperationMixin, TokenOperationView, VmOperationView): ...@@ -836,7 +836,8 @@ class VmRenewView(FormOperationMixin, TokenOperationView, VmOperationView):
choices = Lease.get_objects_with_level("user", self.request.user) choices = Lease.get_objects_with_level("user", self.request.user)
default = self.get_op().instance.lease default = self.get_op().instance.lease
if default and default not in choices: if default and default not in choices:
choices = list(choices) + [default] choices = (choices.distinct() |
Lease.objects.filter(pk=default.pk).distinct())
val = super(VmRenewView, self).get_form_kwargs() val = super(VmRenewView, self).get_form_kwargs()
val.update({'choices': choices, 'default': default}) val.update({'choices': choices, 'default': default})
......
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 sign in to comment