Skip to content

Commit

Permalink
Add filters for UpstreamPulps
Browse files Browse the repository at this point in the history
fixes: #4110
  • Loading branch information
gerrod3 committed Sep 23, 2024
1 parent c3d50bf commit 6a2d120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/4110.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `name`, `base_url` and `last_replication` filters for UpstreamPulps.
6 changes: 6 additions & 0 deletions pulpcore/app/viewsets/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pulpcore.app.viewsets import NamedModelViewSet, RolesMixin
from pulpcore.app.response import TaskGroupOperationResponse
from pulpcore.app.tasks import replicate_distributions
from pulpcore.app.viewsets.base import NAME_FILTER_OPTIONS, DATETIME_FILTER_OPTIONS
from pulpcore.tasking.tasks import dispatch


Expand All @@ -30,6 +31,11 @@ class UpstreamPulpViewSet(
serializer_class = UpstreamPulpSerializer
ordering = "-pulp_created"
queryset_filtering_required_permission = "core.view_upstreampulp"
filterset_fields = {
"name": NAME_FILTER_OPTIONS,
"base_url": NAME_FILTER_OPTIONS,
"last_replication": DATETIME_FILTER_OPTIONS,
}

DEFAULT_ACCESS_POLICY = {
"statements": [
Expand Down

0 comments on commit 6a2d120

Please sign in to comment.