diff --git a/app/api/admin.py b/app/api/admin.py index 88c9c0d4..329e00ef 100644 --- a/app/api/admin.py +++ b/app/api/admin.py @@ -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] diff --git a/app/api/urls.py b/app/api/urls.py index c806d1bd..156b2e79 100644 --- a/app/api/urls.py +++ b/app/api/urls.py @@ -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()),