git://git.onelab.eu
/
unfold.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: merge conflic /portal/views.py
[unfold.git]
/
portal
/
views.py
diff --git
a/portal/views.py
b/portal/views.py
index
ac4e7b8
..
4df9fc8
100644
(file)
--- a/
portal/views.py
+++ b/
portal/views.py
@@
-27,6
+27,8
@@
from django.contrib import messages
from django.views.generic import View
from django.views.generic.base import TemplateView
from django.shortcuts import render
from django.views.generic import View
from django.views.generic.base import TemplateView
from django.shortcuts import render
+from django.utils.decorators import method_decorator
+from django.contrib.auth.decorators import login_required
from plugins.lists.simplelist import SimpleList
from plugins.hazelnut import Hazelnut
from plugins.lists.simplelist import SimpleList
from plugins.hazelnut import Hazelnut
@@
-49,6
+51,11
@@
import os, re
class DashboardView(TemplateView):
template_name = "dashboard.html"
class DashboardView(TemplateView):
template_name = "dashboard.html"
+
+ #This view requires login
+ @method_decorator(login_required)
+ def dispatch(self, *args, **kwargs):
+ return super(DashboardView, self).dispatch(*args, **kwargs)
def get_context_data(self, **kwargs):
# We might have slices on different registries with different user accounts
def get_context_data(self, **kwargs):
# We might have slices on different registries with different user accounts
@@
-472,16
+479,6
@@
class DashboardView(TemplateView):
# DEPRECATED # context.update(page.prelude_env())
# DEPRECATED # return context
# DEPRECATED # context.update(page.prelude_env())
# DEPRECATED # return context
-
-
-# View for my_account form
-def my_account(request):
- return render(request, 'my_account.html', {
- #'form': form,
- 'topmenu_items': topmenu_items('My Account', request),
- 'username': the_user (request)
- })
-
# View for platforms
class PlatformsView(TemplateView):
template_name = "platforms.html"
# View for platforms
class PlatformsView(TemplateView):
template_name = "platforms.html"
@@
-534,6
+531,8
@@
class PlatformsView(TemplateView):
return context
return context
+
+
# View for 1 platform and its details
class PlatformView(TemplateView):
template_name = "platform.html"
# View for 1 platform and its details
class PlatformView(TemplateView):
template_name = "platform.html"
@@
-591,6
+590,18
@@
class PlatformView(TemplateView):
return context
return context
+
+@login_required
+# View for my_account form
+def my_account(request):
+ return render(request, 'my_account.html', {
+ #'form': form,
+ 'topmenu_items': topmenu_items('My Account', request),
+ 'username': the_user (request)
+ })
+
+
+@login_required
#my_acc form value processing
def acc_process(request):
# getting the user_id from the session [now hardcoded]
#my_acc form value processing
def acc_process(request):
# getting the user_id from the session [now hardcoded]
@@
-813,7
+824,7
@@
def contact(request):
})
})
-
+@login_required
def slice_request(request):
if request.method == 'POST': # If the form has been submitted...
form = SliceRequestForm(request.POST) # A form bound to the POST data
def slice_request(request):
if request.method == 'POST': # If the form has been submitted...
form = SliceRequestForm(request.POST) # A form bound to the POST data