Fix AdminGroupViewSet, AdminUserViewSet

pull/1075/head
Piero Toffanin 2021-10-19 12:46:18 -04:00
rodzic 1e4b7e751b
commit 42a51bafb6
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -10,7 +10,7 @@ class UserSerializer(serializers.ModelSerializer):
model = User
fields = '__all__'
class UserViewSet(viewsets.ModelViewSet):
class AdminUserViewSet(viewsets.ModelViewSet):
serializer_class = UserSerializer
permission_classes = [IsAdminUser]
@ -34,7 +34,7 @@ class GroupSerializer(serializers.ModelSerializer):
model = Group
fields = '__all__'
class GroupViewSet(viewsets.ModelViewSet):
class AdminGroupViewSet(viewsets.ModelViewSet):
serializer_class = GroupSerializer
permission_classes = [IsAdminUser]

Wyświetl plik

@ -6,7 +6,7 @@ from .projects import ProjectViewSet
from .tasks import TaskViewSet, TaskDownloads, TaskAssets, TaskAssetsImport
from .imageuploads import Thumbnail, ImageDownload
from .processingnodes import ProcessingNodeViewSet, ProcessingNodeOptionsView
from .admin import UserViewSet, GroupViewSet
from .admin import AdminUserViewSet, AdminGroupViewSet
from rest_framework_nested import routers
from rest_framework_jwt.views import obtain_jwt_token
from .tiler import TileJson, Bounds, Metadata, Tiles, Export
@ -27,8 +27,8 @@ tasks_router = routers.NestedSimpleRouter(router, r'projects', lookup='project')
tasks_router.register(r'tasks', TaskViewSet, base_name='projects-tasks')
admin_router = routers.DefaultRouter()
admin_router.register(r'admin/users', UserViewSet, base_name='admin-users')
admin_router.register(r'admin/groups', GroupViewSet, base_name='admin-groups')
admin_router.register(r'admin/users', AdminUserViewSet, base_name='admin-users')
admin_router.register(r'admin/groups', AdminGroupViewSet, base_name='admin-groups')
urlpatterns = [
url(r'processingnodes/options/$', ProcessingNodeOptionsView.as_view()),