Skip to content

Commit

Permalink
Move api router registration to app ready
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanw committed Sep 19, 2024
1 parent 56323f4 commit 55a8a36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions froide_campaign/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ def ready(self):
registry.register(export_user_data)
account_merged.connect(merge_user)

from froide.api import api_router

from .api_views import InformationObjectViewSet

api_router.register(
r"campaigninformationobject",
InformationObjectViewSet,
basename="campaigninformationobject",
)

@menu_registry.register
def get_campaign_menu_item(request):
if not request.user.has_perm("froide_campaign.can_use_campaigns"):
Expand Down
10 changes: 0 additions & 10 deletions froide_campaign/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
from django.urls import path

from froide.api import api_router

from .api_views import InformationObjectViewSet
from .views import (
AssignCampaignPageTeamView,
CampaignPageEditView,
Expand Down Expand Up @@ -46,10 +43,3 @@
name="campaign-add_campaign_report",
),
]


api_router.register(
r"campaigninformationobject",
InformationObjectViewSet,
basename="campaigninformationobject",
)

0 comments on commit 55a8a36

Please sign in to comment.