Move api router registration to app ready

This commit is contained in:
Stefan Wehrmeyer 2024-09-19 20:47:52 +02:00
parent 9b2c2156c7
commit 1dd2717ff2
2 changed files with 8 additions and 8 deletions

View file

@ -7,8 +7,14 @@ class FroideGovPlanConfig(AppConfig):
verbose_name = _("GovPlan App")
def ready(self):
from froide.api import api_router
from froide.follow.configuration import follow_registry
from .api_views import GovernmentPlanViewSet
from .configuration import GovernmentPlanFollowConfiguration
follow_registry.register(GovernmentPlanFollowConfiguration())
api_router.register(
r"governmentplan", GovernmentPlanViewSet, basename="governmentplan"
)