aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow
diff options
context:
space:
mode:
authorJustin Choquette <jchoquette@iol.unh.edu>2023-10-23 16:24:13 -0400
committerJustin Choquette <jchoquette@iol.unh.edu>2023-10-25 16:26:17 -0400
commita4ba880252b2bad72df3f16dd11fdf2206825335 (patch)
tree3d2852284728814ba546ae2719f47fe641b0f544 /src/workflow
parentaff53e072502d63d8002d9c83213ce7f9d12c352 (diff)
Single Template Selection For Compatible Dashboardsliblaas-mvp
Change-Id: I0a795c2c49fdbe0427182a8789d622003997efcd Signed-off-by: Justin Choquette <jchoquette@iol.unh.edu>
Diffstat (limited to 'src/workflow')
-rw-r--r--src/workflow/views.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/workflow/views.py b/src/workflow/views.py
index a85ac09..947c177 100644
--- a/src/workflow/views.py
+++ b/src/workflow/views.py
@@ -7,9 +7,8 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import json
from django.shortcuts import render, redirect
-from laas_dashboard.settings import TEMPLATE_OVERRIDE
+from laas_dashboard.settings import PROJECT
from django.http import HttpResponse
from liblaas.views import user_get_user
from workflow.forms import BookingMetaForm
@@ -31,9 +30,10 @@ def design_a_pod_view(request):
if (not profile or profile.ipa_username == None):
return redirect("dashboard:index")
+ constraints = get_workflow_contraints(PROJECT)
template = "workflow/design_a_pod.html"
context = {
- "dashboard": str(TEMPLATE_OVERRIDE)
+ "constraints": constraints,
}
return render(request, template, context)
@@ -51,7 +51,7 @@ def book_a_pod_view(request):
return redirect("dashboard:index")
vpn_user = user_get_user(profile.ipa_username)
-
+
# These booleans need to be represented as strings, due to the way jinja interprets them
prereqs = {
"company": "true" if ("ou" in vpn_user and vpn_user["ou"] != "") else "false",
@@ -60,10 +60,23 @@ def book_a_pod_view(request):
template = "workflow/book_a_pod.html"
context = {
- "dashboard": str(TEMPLATE_OVERRIDE),
"form": BookingMetaForm(initial={}, user_initial=[], owner=request.user),
"prereqs": prereqs
}
return render(request, template, context)
+def get_workflow_contraints(project: str) -> dict:
+
+ if project == 'anuket':
+ return {
+ "max_hosts": 8,
+ }
+
+ if project == 'lfedge':
+ return {
+ "max_hosts": "null",
+ }
+
+ return {}
+