From 105b8c180a9f76c6cb443dcb7e4f2dc8d99964e2 Mon Sep 17 00:00:00 2001 From: "Ing. Jan KRCMAR" Date: Thu, 6 Sep 2018 14:26:29 +0200 Subject: [PATCH] view instance: check_user_quota is not performed for superuser --- instances/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/instances/views.py b/instances/views.py index ac188ed..cb46105 100644 --- a/instances/views.py +++ b/instances/views.py @@ -274,6 +274,12 @@ def instance(request, compute_id, vname): return free_names def check_user_quota(instance, cpu, memory, disk_size): + ua = request.user.userattributes + msg = "" + + if request.user.is_superuser: + return msg + user_instances = UserInstance.objects.filter(user_id=request.user.id, instance__is_template=False) instance += user_instances.count() for usr_inst in user_instances: @@ -290,8 +296,6 @@ def instance(request, compute_id, vname): if disk['size']: disk_size += int(disk['size'])>>30 - ua = request.user.userattributes - msg = "" if ua.max_instances > 0 and instance > ua.max_instances: msg = "instance" if settings.QUOTA_DEBUG: