Commit c8d4ae25 by Bach Dániel

dashboard: fix lease queryset in TemplateForm

parent 4e5dd156
...@@ -616,8 +616,11 @@ class TemplateForm(forms.ModelForm): ...@@ -616,8 +616,11 @@ class TemplateForm(forms.ModelForm):
self.instance.ram_size = 512 self.instance.ram_size = 512
self.instance.num_cores = 2 self.instance.num_cores = 2
self.fields["lease"].queryset = Lease.get_objects_with_level( lease_queryset = (
"operator", self.user) Lease.get_objects_with_level("operator", self.user).distinct()
| Lease.objects.filter(pk=self.instance.lease_id).distinct())
self.fields["lease"].queryset = lease_queryset
def clean_owner(self): def clean_owner(self):
if self.instance.pk is not None: if self.instance.pk is not None:
......
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