aboutsummaryrefslogtreecommitdiffstats
path: root/src/account/views.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2020-03-16 17:54:09 +0000
committerGerrit Code Review <gerrit@opnfv.org>2020-03-16 17:54:09 +0000
commit0db3a84d9d9ed213983a517efd35c339537ef472 (patch)
treea6d7ac7ba2f2d70e18cb984bda4020c736082c62 /src/account/views.py
parent176ec9aacbc87e6077e8807c60f95a1ccbbc26e3 (diff)
parent064f145f218385a6401fa6be2ccbbc462e915c26 (diff)
Merge "Test resource templates now use the same lab as the image generated alongside it."
Diffstat (limited to 'src/account/views.py')
-rw-r--r--src/account/views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/account/views.py b/src/account/views.py
index ccc4c8d..a8bb02b 100644
--- a/src/account/views.py
+++ b/src/account/views.py
@@ -33,7 +33,7 @@ from account.forms import AccountSettingsForm
from account.jira_util import SignatureMethod_RSA_SHA1
from account.models import UserProfile
from booking.models import Booking
-from resource_inventory.models import GenericResourceBundle, ConfigBundle, Image
+from resource_inventory.models import ResourceTemplate, Image
@method_decorator(login_required, name='dispatch')
@@ -177,7 +177,7 @@ def account_resource_view(request):
if not request.user.is_authenticated:
return render(request, "dashboard/login.html", {'title': 'Authentication Required'})
template = "account/resource_list.html"
- resources = GenericResourceBundle.objects.filter(
+ resources = ResourceTemplate.objects.filter(
owner=request.user).prefetch_related("configbundle_set")
mapping = {}
resource_list = []
@@ -218,7 +218,7 @@ def account_configuration_view(request):
if not request.user.is_authenticated:
return render(request, "dashboard/login.html", {'title': 'Authentication Required'})
template = "account/configuration_list.html"
- configs = list(ConfigBundle.objects.filter(owner=request.user))
+ configs = list(ResourceTemplate.objects.filter(owner=request.user))
context = {"title": "Configuration List", "configurations": configs}
return render(request, template, context=context)
@@ -245,7 +245,7 @@ def account_images_view(request):
def resource_delete_view(request, resource_id=None):
if not request.user.is_authenticated:
return HttpResponse('no') # 403?
- grb = get_object_or_404(GenericResourceBundle, pk=resource_id)
+ grb = get_object_or_404(ResourceTemplate, pk=resource_id)
if not request.user.id == grb.owner.id:
return HttpResponse('no') # 403?
if Booking.objects.filter(resource__template=grb, end__gt=timezone.now()).exists():
@@ -257,7 +257,7 @@ def resource_delete_view(request, resource_id=None):
def configuration_delete_view(request, config_id=None):
if not request.user.is_authenticated:
return HttpResponse('no') # 403?
- config = get_object_or_404(ConfigBundle, pk=config_id)
+ config = get_object_or_404(ResourceTemplate, pk=config_id)
if not request.user.id == config.owner.id:
return HttpResponse('no') # 403?
if Booking.objects.filter(config_bundle=config, end__gt=timezone.now()).exists():