diff --git a/meinberlin/apps/extprojects/api.py b/meinberlin/apps/extprojects/api.py index c914b31263..8dad88ec43 100644 --- a/meinberlin/apps/extprojects/api.py +++ b/meinberlin/apps/extprojects/api.py @@ -7,7 +7,7 @@ from meinberlin.apps.extprojects.serializers import ExternalProjectSerializer -class ExternalProjectListViewSet(viewsets.ReadOnlyModelViewSet): +class ExternalProjectViewSet(viewsets.ReadOnlyModelViewSet): def get_queryset(self): return ExternalProject.objects.filter( project_type="meinberlin_extprojects.ExternalProject", diff --git a/meinberlin/apps/plans/api.py b/meinberlin/apps/plans/api.py index 6f11939739..8e18df8319 100644 --- a/meinberlin/apps/plans/api.py +++ b/meinberlin/apps/plans/api.py @@ -5,7 +5,7 @@ from meinberlin.apps.plans.serializers import PlanSerializer -class PlansListViewSet(viewsets.ReadOnlyModelViewSet): +class PlansViewSet(viewsets.ReadOnlyModelViewSet): serializer_class = PlanSerializer def get_queryset(self): diff --git a/meinberlin/apps/projectcontainers/api.py b/meinberlin/apps/projectcontainers/api.py index bb6b343ce7..1600cfa5d4 100644 --- a/meinberlin/apps/projectcontainers/api.py +++ b/meinberlin/apps/projectcontainers/api.py @@ -7,7 +7,7 @@ from meinberlin.apps.projectcontainers.serializers import ProjectContainerSerializer -class ProjectContainerListViewSet(viewsets.ReadOnlyModelViewSet): +class ProjectContainerViewSet(viewsets.ReadOnlyModelViewSet): def get_queryset(self): return ProjectContainer.objects.filter( is_draft=False, access=Access.PUBLIC, is_archived=False diff --git a/meinberlin/apps/projects/api.py b/meinberlin/apps/projects/api.py index df7e8b2d0b..733312b4a8 100644 --- a/meinberlin/apps/projects/api.py +++ b/meinberlin/apps/projects/api.py @@ -12,7 +12,7 @@ from meinberlin.apps.projects.filters import StatusFilter -class ProjectListViewSet(viewsets.ReadOnlyModelViewSet): +class ProjectViewSet(viewsets.ReadOnlyModelViewSet): filter_backends = (DjangoFilterBackend, StatusFilter) def __init__(self, *args, **kwargs): @@ -64,7 +64,7 @@ def get_serializer(self, *args, **kwargs): return project_serializers.ProjectSerializer(now=self.now, *args, **kwargs) -class PrivateProjectListViewSet(viewsets.ReadOnlyModelViewSet): +class PrivateProjectViewSet(viewsets.ReadOnlyModelViewSet): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) now = timezone.now() diff --git a/meinberlin/config/urls.py b/meinberlin/config/urls.py index b293eb50dd..f47d74cf61 100644 --- a/meinberlin/config/urls.py +++ b/meinberlin/config/urls.py @@ -25,15 +25,15 @@ from meinberlin.apps.contrib.sitemaps.adhocracy4_sitemap import Adhocracy4Sitemap from meinberlin.apps.contrib.sitemaps.static_sitemap import StaticSitemap from meinberlin.apps.documents.api import DocumentViewSet -from meinberlin.apps.extprojects.api import ExternalProjectListViewSet +from meinberlin.apps.extprojects.api import ExternalProjectViewSet from meinberlin.apps.likes.api import LikesViewSet from meinberlin.apps.likes.routers import LikesDefaultRouter from meinberlin.apps.livequestions.api import LiveQuestionViewSet from meinberlin.apps.moderatorremark.api import ModeratorRemarkViewSet -from meinberlin.apps.plans.api import PlansListViewSet -from meinberlin.apps.projectcontainers.api import ProjectContainerListViewSet -from meinberlin.apps.projects.api import PrivateProjectListViewSet -from meinberlin.apps.projects.api import ProjectListViewSet +from meinberlin.apps.plans.api import PlansViewSet +from meinberlin.apps.projectcontainers.api import ProjectContainerViewSet +from meinberlin.apps.projects.api import PrivateProjectViewSet +from meinberlin.apps.projects.api import ProjectViewSet from meinberlin.apps.users.decorators import user_is_project_admin from meinberlin.apps.votes.api import TokenVoteViewSet from meinberlin.apps.votes.routers import TokenVoteDefaultRouter @@ -46,13 +46,11 @@ router.register(r"follows", FollowViewSet, basename="follows") router.register(r"reports", ReportViewSet, basename="reports") router.register(r"polls", PollViewSet, basename="polls") -router.register(r"projects", ProjectListViewSet, basename="projects") -router.register( - r"privateprojects", PrivateProjectListViewSet, basename="privateprojects" -) -router.register(r"plans", PlansListViewSet, basename="plans") -router.register(r"extprojects", ExternalProjectListViewSet, basename="extprojects") -router.register(r"containers", ProjectContainerListViewSet, basename="containers") +router.register(r"projects", ProjectViewSet, basename="projects") +router.register(r"privateprojects", PrivateProjectViewSet, basename="privateprojects") +router.register(r"plans", PlansViewSet, basename="plans") +router.register(r"extprojects", ExternalProjectViewSet, basename="extprojects") +router.register(r"containers", ProjectContainerViewSet, basename="containers") module_router = a4routers.ModuleDefaultRouter() # FIXME: rename to 'chapters'