mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 03:17:07 +00:00
fix: Add login required on all remaining views
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import csv
|
||||
import typing
|
||||
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic.list import BaseListView
|
||||
|
||||
from .. import models, serializers
|
||||
|
||||
|
||||
class CsvExportView(BaseListView):
|
||||
class CsvExportView(LoginRequiredMixin, BaseListView):
|
||||
model = None
|
||||
serializer_class = None
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
Views for displaying or manipulating instances of :class:`Person`.
|
||||
"""
|
||||
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import CreateView, DetailView, ListView, UpdateView
|
||||
|
||||
from people import forms, models, permissions
|
||||
|
||||
|
||||
class PersonCreateView(CreateView):
|
||||
class PersonCreateView(LoginRequiredMixin, CreateView):
|
||||
"""
|
||||
View to create a new instance of :class:`Person`.
|
||||
|
||||
@@ -24,7 +25,7 @@ class PersonCreateView(CreateView):
|
||||
return super().form_valid(form)
|
||||
|
||||
|
||||
class PersonListView(ListView):
|
||||
class PersonListView(LoginRequiredMixin, ListView):
|
||||
"""
|
||||
View displaying a list of :class:`Person` objects - searchable.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user