From 450c4c758ad0b9c1c3f6568aeb0b7b52fe737cd9 Mon Sep 17 00:00:00 2001 From: Nikita Manovich Date: Thu, 7 Feb 2019 18:51:42 +0300 Subject: [PATCH] Add list for users, slightly improved server/exception --- cvat/apps/engine/serializers.py | 17 ++++++++++------- cvat/apps/engine/urls.py | 2 +- cvat/apps/engine/views.py | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index 64283269d34f..2105e416dd11 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -258,16 +258,19 @@ class Meta: write_only_fields = ('password', ) class ExceptionSerializer(serializers.Serializer): - task = serializers.IntegerField() - job = serializers.IntegerField() - message = serializers.CharField(max_length=1000) + system = serializers.CharField(max_length=255) + client = serializers.CharField(max_length=255) + + task = serializers.IntegerField(allow_null=True) + job = serializers.IntegerField(allow_null=True) + + message = serializers.CharField(max_length=4096) filename = serializers.URLField() line = serializers.IntegerField() column = serializers.IntegerField() - stack = serializers.CharField(max_length=10000, - style={'base_template': 'textarea.html'}) - browser = serializers.CharField(max_length=255) - os = serializers.CharField(max_length=255) + stack = serializers.CharField(max_length=8192, + style={'base_template': 'textarea.html'}, allow_null=True) + class AboutSerializer(serializers.Serializer): name = serializers.CharField(max_length=128) diff --git a/cvat/apps/engine/urls.py b/cvat/apps/engine/urls.py index d7786a4a1275..511b46741289 100644 --- a/cvat/apps/engine/urls.py +++ b/cvat/apps/engine/urls.py @@ -12,7 +12,7 @@ router.register('tasks', views.TaskViewSet) router.register('jobs', views.JobViewSet) router.register('users', views.UserViewSet) -router.register('', views.ServerViewSet, basename='server') +router.register('server', views.ServerViewSet, basename='server') router.register('plugins', views.PluginViewSet) urlpatterns = [ diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index 671c30381427..7a434fe9cdd6 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -194,7 +194,7 @@ def annotations(self, request, pk): pass -class UserViewSet(viewsets.GenericViewSet, +class UserViewSet(viewsets.GenericViewSet, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin): queryset = User.objects.all() serializer_class = UserSerializer