[Bugfix] 修复创建node节点的问题,修复windows session的问题

pull/1331/merge
ibuler 2018-05-15 14:44:02 +08:00
parent ebc1b4975a
commit cb4afabc91
2 changed files with 7 additions and 4 deletions

View File

@ -51,10 +51,10 @@ class NodeViewSet(BulkModelViewSet):
else:
return serializers.NodeSerializer
# def perform_create(self, serializer):
# child_key = Node.root().get_next_child_key()
# serializer.validated_data["key"] = child_key
# serializer.save()
def perform_create(self, serializer):
child_key = Node.root().get_next_child_key()
serializer.validated_data["key"] = child_key
serializer.save()
class NodeWithAssetsApi(generics.ListAPIView):

View File

@ -108,6 +108,9 @@ class StatusViewSet(viewsets.ModelViewSet):
task_serializer_class = TaskSerializer
def create(self, request, *args, **kwargs):
if self.request.query_params.get("from_guacamole", None):
return Response({"msg": "From guacamole, not support now"})
self.handle_sessions()
super().create(request, *args, **kwargs)
tasks = self.request.user.terminal.task_set.filter(is_finished=False)