Commit a5106f3d by Őry Máté

dashboard: make 💩 code more readable

parent ffbd9baa
......@@ -2120,9 +2120,11 @@ class VmCreate(LoginRequiredMixin, TemplateView):
if not request.user.has_perm('vm.create_vm'):
raise PermissionDenied()
form_error = form is not None
template_pk = (form.template.pk if form_error
else request.GET.get("template"))
if form is None:
template_pk = request.GET.get("template")
else:
template_pk = form.template.pk
if template_pk:
template = get_object_or_404(InstanceTemplate, pk=template_pk)
if not template.has_level(request.user, 'user'):
......
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