summaryrefslogtreecommitdiff
path: root/workshop_portal/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'workshop_portal/views.py')
-rw-r--r--workshop_portal/views.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/workshop_portal/views.py b/workshop_portal/views.py
new file mode 100644
index 0000000..e166039
--- /dev/null
+++ b/workshop_portal/views.py
@@ -0,0 +1,16 @@
+# Django Imports
+from django.shortcuts import redirect
+from django.urls import reverse
+from django.conf import settings
+
+# Local Imports
+from cms.models import Page
+
+
+def index(request):
+ page = Page.objects.filter(title=settings.HOME_PAGE_TITLE)
+ if page.exists():
+ redirect_url = reverse("cms:home", args=[page.first().permalink])
+ else:
+ redirect_url = reverse("workshop_app:index")
+ return redirect(redirect_url)