fix(network): Require login for network view

This commit is contained in:
James Graham
2020-03-09 12:52:29 +00:00
parent 512590d615
commit 09b7fc334b
2 changed files with 12 additions and 1 deletions

View File

@@ -134,6 +134,16 @@ DBBACKUP_STORAGE_OPTIONS = {
} }
# Django REST Framework
# https://www.django-rest-framework.org/
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
}
# Password validation # Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators

View File

@@ -2,6 +2,7 @@
Views for displaying or manipulating models in the 'people' app. Views for displaying or manipulating models in the 'people' app.
""" """
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.urls import reverse from django.urls import reverse
from django.views.generic import CreateView, DetailView, ListView, TemplateView, UpdateView from django.views.generic import CreateView, DetailView, ListView, TemplateView, UpdateView
@@ -206,7 +207,7 @@ class RelationshipApiView(APIView):
return Response(serializer.data) return Response(serializer.data)
class NetworkView(TemplateView): class NetworkView(LoginRequiredMixin, TemplateView):
""" """
View to display relationship network. View to display relationship network.
""" """