.
This commit is contained in:
+17
-17
@@ -75,13 +75,13 @@ from django_tables2 import SingleTableView, SingleTableMixin
|
||||
from django_filters.views import FilterView
|
||||
|
||||
from .decorators import (
|
||||
user_is_author_or_atlas_checker,
|
||||
user_is_author_or_atlas_checker_or_atlas_marker,
|
||||
user_is_author_or_atlas_editor,
|
||||
user_is_author_or_atlas_editor_or_atlas_marker,
|
||||
user_is_author_or_atlas_series_checker_or_atlas_marker,
|
||||
user_is_atlas_checker,
|
||||
user_is_atlas_editor,
|
||||
user_is_author_or_atlas_series_checker,
|
||||
user_is_atlas_marker,
|
||||
user_is_author_or_atlas_checker_or_atlas_marker,
|
||||
user_is_author_or_atlas_editor_or_atlas_marker,
|
||||
)
|
||||
|
||||
from collections import defaultdict
|
||||
@@ -116,7 +116,7 @@ class AuthorOrCheckerRequiredMixin(object):
|
||||
def get_object(self, *args, **kwargs):
|
||||
obj = super().get_object(*args, **kwargs)
|
||||
if (
|
||||
self.request.user.groups.filter(name="atlas_checker").exists()
|
||||
self.request.user.groups.filter(name="atlas_editor").exists()
|
||||
or self.request.user.is_superuser
|
||||
):
|
||||
return obj
|
||||
@@ -126,7 +126,7 @@ class AuthorOrCheckerRequiredMixin(object):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_author_or_atlas_checker_or_atlas_marker
|
||||
@user_is_author_or_atlas_editor_or_atlas_marker
|
||||
def case_detail(request, pk):
|
||||
case = get_object_or_404(Case, pk=pk)
|
||||
|
||||
@@ -163,7 +163,7 @@ def series_detail(request, pk, finding_pk=None):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_atlas_checker
|
||||
@user_is_atlas_editor
|
||||
def condition_detail(request, pk):
|
||||
condition = get_object_or_404(Condition, pk=pk)
|
||||
|
||||
@@ -178,7 +178,7 @@ def condition_detail(request, pk):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_atlas_checker
|
||||
@user_is_atlas_editor
|
||||
def subspecialty_detail(request, pk):
|
||||
subspecialty = get_object_or_404(Subspecialty, pk=pk)
|
||||
|
||||
@@ -193,7 +193,7 @@ def subspecialty_detail(request, pk):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_atlas_checker
|
||||
@user_is_atlas_editor
|
||||
def presentation_detail(request, pk):
|
||||
presentation = get_object_or_404(Presentation, pk=pk)
|
||||
|
||||
@@ -208,7 +208,7 @@ def presentation_detail(request, pk):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_atlas_checker
|
||||
@user_is_atlas_editor
|
||||
def pathological_process_detail(request, pk):
|
||||
pathological_process = get_object_or_404(PathologicalProcess, pk=pk)
|
||||
|
||||
@@ -223,7 +223,7 @@ def pathological_process_detail(request, pk):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_atlas_checker
|
||||
@user_is_atlas_editor
|
||||
def structure_detail(request, pk):
|
||||
structure = get_object_or_404(Structure, pk=pk)
|
||||
|
||||
@@ -238,7 +238,7 @@ def structure_detail(request, pk):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_atlas_checker
|
||||
@user_is_atlas_editor
|
||||
def finding_detail(request, pk):
|
||||
finding = get_object_or_404(Finding, pk=pk)
|
||||
|
||||
@@ -253,7 +253,7 @@ def finding_detail(request, pk):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_author_or_atlas_checker
|
||||
@user_is_author_or_atlas_editor
|
||||
def author_detail(request, pk):
|
||||
# logging.debug(Author.objects.all())
|
||||
# author = get_object_or_404(Author, pk=pk)
|
||||
@@ -266,7 +266,7 @@ def author_detail(request, pk):
|
||||
)
|
||||
|
||||
|
||||
@user_is_author_or_atlas_checker
|
||||
@user_is_author_or_atlas_editor
|
||||
def author_list(request):
|
||||
authors = User.objects.all()
|
||||
|
||||
@@ -316,7 +316,7 @@ class StructureDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_author_or_atlas_checker
|
||||
@user_is_author_or_atlas_editor
|
||||
def case_clone(request, pk):
|
||||
new_item = get_object_or_404(Case, pk=pk)
|
||||
new_item.pk = None # autogen a new pk (item_id)
|
||||
@@ -610,7 +610,7 @@ class AtlasClone(AtlasCreateBase, CreateView):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_author_or_atlas_checker
|
||||
@user_is_author_or_atlas_editor
|
||||
def atlas_scrap(request, pk):
|
||||
try:
|
||||
atlas = Case.objects.get(pk=pk)
|
||||
@@ -879,7 +879,7 @@ class StructureAutocomplete(autocomplete.Select2QuerySetView):
|
||||
|
||||
|
||||
@login_required
|
||||
@user_is_atlas_checker
|
||||
@user_is_atlas_editor
|
||||
def categories_list(request):
|
||||
# condition = get_object_or_404(Condition, pk=pk)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user