Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def href_prn_list_handler(value):
"""Common list parsing for a string of hrefs/prns."""
r = re.compile(
rf"""
(?:{settings.API_ROOT}(?:[-_a-zA-Z0-9]+/)?api/v3/repositories/python/python/[-a-f0-9]+/)
(?:{settings.API_ROOT}(?:[-_a-zA-Z0-9]+/)?api/v\d+/repositories/python/python/[-a-f0-9]+/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

|(?:prn:python\.pythonrepository:[-a-f0-9]+)
""",
re.VERBOSE,
Expand Down
12 changes: 6 additions & 6 deletions pulp_python/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class PythonRepositoryViewSet(
responses={202: AsyncOperationResponseSerializer},
)
@action(detail=True, methods=["post"], serializer_class=RepositoryAddRemoveContentSerializer)
def modify(self, request, pk):
def modify(self, request, pk, **kwargs):
"""
Queues a task that creates a new RepositoryVersion by adding and removing content units.

Expand Down Expand Up @@ -196,7 +196,7 @@ def _early_blocklist_check(self, repository, content_ids):
responses={202: AsyncOperationResponseSerializer},
)
@action(detail=True, methods=["post"], serializer_class=None)
def repair_metadata(self, request, pk):
def repair_metadata(self, request, pk, **kwargs):
"""
Trigger an asynchronous task to repair Python metadata. This task will repair metadata
of all packages for the specified `Repository`, without creating a new `RepositoryVersion`.
Expand All @@ -212,7 +212,7 @@ def repair_metadata(self, request, pk):

@extend_schema(summary="Sync from remote", responses={202: AsyncOperationResponseSerializer})
@action(detail=True, methods=["post"], serializer_class=RepositorySyncURLSerializer)
def sync(self, request, pk):
def sync(self, request, pk, **kwargs):
"""
<!-- User-facing documentation, rendered as html-->
Trigger an asynchronous task to sync python content. The sync task will retrieve Python
Expand Down Expand Up @@ -576,7 +576,7 @@ class PythonPackageSingleArtifactContentUploadViewSet(
methods=["post"],
serializer_class=python_serializers.PythonPackageContentUploadSerializer,
)
def upload(self, request):
def upload(self, request, **kwargs):
"""
Create a Python package.
"""
Expand Down Expand Up @@ -748,7 +748,7 @@ class PythonRemoteViewSet(core_viewsets.RemoteViewSet, core_viewsets.RolesMixin)
methods=["post"],
serializer_class=python_serializers.PythonBanderRemoteSerializer,
)
def from_bandersnatch(self, request):
def from_bandersnatch(self, request, **kwargs):
"""
<!-- User-facing documentation, rendered as html-->
Takes the fields specified in the Bandersnatch config and creates a Python Remote from it.
Expand Down Expand Up @@ -875,7 +875,7 @@ class PythonPublicationViewSet(core_viewsets.PublicationViewSet, core_viewsets.R
}

@extend_schema(responses={202: AsyncOperationResponseSerializer}, deprecated=True)
def create(self, request):
def create(self, request, **kwargs):
"""
<!-- User-facing documentation, rendered as html-->
Dispatches a publish task, which generates metadata that will be used by pip.
Expand Down
2 changes: 1 addition & 1 deletion pulp_python/tests/functional/api/test_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_domain_object_creation(
domain_name = domain.name

repo = python_repo_factory(pulp_domain=domain_name)
assert f"{domain_name}/api/v3/" in repo.pulp_href
assert f"{domain_name}/api/" in repo.pulp_href

repos = python_bindings.RepositoriesPythonApi.list(pulp_domain=domain_name)
assert repos.count == 1
Expand Down