Merge pull request #1636 from normanjaeckel/AgendaTree
Fixed agenda tree, fixed #1635.
This commit is contained in:
commit
ddafb6682a
@ -394,7 +394,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
|
|||||||
// set changed agenda tree
|
// set changed agenda tree
|
||||||
$scope.treeOptions = {
|
$scope.treeOptions = {
|
||||||
dropped: function() {
|
dropped: function() {
|
||||||
$http.put('/rest/agenda/item/tree/', {tree: $scope.tree});
|
$http.put('/rest/agenda/item/tree/', {tree: $scope.items});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -200,12 +200,20 @@ class ItemViewSet(ModelViewSet):
|
|||||||
request.user.has_perm('agenda.can_see_orga_items')):
|
request.user.has_perm('agenda.can_see_orga_items')):
|
||||||
self.permission_denied(request)
|
self.permission_denied(request)
|
||||||
try:
|
try:
|
||||||
Item.objects.set_tree(request.data['tree'])
|
tree = request.data['tree']
|
||||||
except ValueError as error:
|
except KeyError as error:
|
||||||
return Response({'detail': str(error)}, status=400)
|
response = Response({'detail': 'Agenda tree is missing.'}, status=400)
|
||||||
else:
|
else:
|
||||||
return Response({'detail': 'Agenda tree successfully updated.'})
|
try:
|
||||||
return Response(Item.objects.get_tree())
|
Item.objects.set_tree(tree)
|
||||||
|
except ValueError as error:
|
||||||
|
response = Response({'detail': str(error)}, status=400)
|
||||||
|
else:
|
||||||
|
response = Response({'detail': 'Agenda tree successfully updated.'})
|
||||||
|
else:
|
||||||
|
# request.method == 'GET'
|
||||||
|
response = Response(Item.objects.get_tree())
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
# Views to generate PDFs
|
# Views to generate PDFs
|
||||||
|
Loading…
Reference in New Issue
Block a user