Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api urls for ts-scanners #1053

Open
wants to merge 1 commit into
base: 07-18-Add_CS_views_for_creating_and_deleting_service_accounts
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion django/thunderstore/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
UserDeleteAPIView,
UserLinkedAccountDisconnectAPIView,
)
from thunderstore.plugins.registry import plugin_registry

cyberstorm_urls = [
path(
Expand Down Expand Up @@ -172,4 +173,4 @@
EditTeamMemberAPIView.as_view(),
name="cyberstorm.team.members.edit",
),
]
] + plugin_registry.get_api_urls()
4 changes: 4 additions & 0 deletions django/thunderstore/plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def get_legacy_package_urls(cls) -> List[URLPattern]:
def get_new_package_urls(cls) -> List[URLPattern]:
return []

@classmethod
def get_api_urls(cls) -> List[URLPattern]:
return []

@classmethod
def get_package_tabs(
cls,
Expand Down
3 changes: 3 additions & 0 deletions django/thunderstore/plugins/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def get_legacy_package_urls(self) -> List[URLPattern]:
def get_new_package_urls(self) -> List[URLPattern]:
return list(itertools.chain(*(x.get_new_package_urls() for x in self.plugins)))

def get_api_urls(self) -> List[URLPattern]:
return list(itertools.chain(*(x.get_api_urls() for x in self.plugins)))

def get_package_tabs(
self, user: "UserType", listing: "PackageListing"
) -> Dict[str, "PartialTab"]:
Expand Down
Loading