Merge pull request #4557 from FinnStutzenstein/removeUnnecessaryView
Remove unnecessary view (fixed #4549)
This commit is contained in:
commit
aa9af9db8c
@ -47,13 +47,7 @@ class ItemViewSet(
|
|||||||
result = has_perm(self.request.user, "agenda.can_see")
|
result = has_perm(self.request.user, "agenda.can_see")
|
||||||
# For manage_speaker and tree requests the rest of the check is
|
# For manage_speaker and tree requests the rest of the check is
|
||||||
# done in the specific method. See below.
|
# done in the specific method. See below.
|
||||||
elif self.action in (
|
elif self.action in ("partial_update", "update", "sort", "assign"):
|
||||||
"partial_update",
|
|
||||||
"update",
|
|
||||||
"sort",
|
|
||||||
"sort_whole",
|
|
||||||
"assign",
|
|
||||||
):
|
|
||||||
result = (
|
result = (
|
||||||
has_perm(self.request.user, "agenda.can_see")
|
has_perm(self.request.user, "agenda.can_see")
|
||||||
and has_perm(self.request.user, "agenda.can_see_internal_items")
|
and has_perm(self.request.user, "agenda.can_see_internal_items")
|
||||||
@ -343,21 +337,6 @@ class ItemViewSet(
|
|||||||
"""
|
"""
|
||||||
return self.sort_tree(request, Item, "weight", "parent_id")
|
return self.sort_tree(request, Item, "weight", "parent_id")
|
||||||
|
|
||||||
@list_route(methods=["post"])
|
|
||||||
def sort_whole(self, request):
|
|
||||||
"""
|
|
||||||
Sorts the whole agenda represented in a tree of ids. The request data should be a list (the root)
|
|
||||||
of all main agenda items. Each node is a dict with an id and optional all children:
|
|
||||||
{
|
|
||||||
id: <the id>
|
|
||||||
children: [
|
|
||||||
<children, optional>
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Every id has to be given.
|
|
||||||
"""
|
|
||||||
return self.sort_tree(request, Item, "weight", "parent_id")
|
|
||||||
|
|
||||||
@list_route(methods=["post"])
|
@list_route(methods=["post"])
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def assign(self, request):
|
def assign(self, request):
|
||||||
|
Loading…
Reference in New Issue
Block a user