Project

Profile

Help

Issue #5533

Pulp incorrectly namespaces Detail model endpoints if there is no master viewset

Added by daviddavis 6 months ago. Updated 4 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 60

Description

Context: https://www.redhat.com/archives/pulp-dev/2019-October/msg00021.html

Suppose you have a viewset for a Detail model that doesn't inherit from the Master viewset (ContentViewset in this case):

class DistributionTreeViewSet(NamedModelViewSet,
                              mixins.RetrieveModelMixin,
                              mixins.ListModelMixin,
                              mixins.DestroyModelMixin):
    """
    Distribution Tree Viewset.
    """

    endpoint_name = 'distribution_trees'
    queryset = DistributionTree.objects.all()
    serializer_class = DistributionTreeSerializer

Pulp will automatically try to define the endpoint using master_endpoint (which doesn't exist), app_label, and endpoint_name. In this case, this ends up being "/pulp/api/v3/distribution_trees/rpm/distribution_trees/" which is probably not what the plugin writer wants.

Associated revisions

Revision 0aa99adb View on GitHub
Added by daviddavis 6 months ago

Fix Detail viewsets erroneous namespacing

If there is no Master viewset, don't automatically try to namespace the viewset endpoint as it erroneously namespaces the endpoint with the detail viewset's endpoint_name.

fixes #5533 https://pulp.plan.io/issues/5533

History

#1 Updated by daviddavis 6 months ago

  • Subject changed from Pulp automatically namespaces Detail model endpoints to Pulp incorrectly namespaces Detail model endpoints if there is no master viewset

#2 Updated by daviddavis 6 months ago

  • Status changed from NEW to POST
  • Assignee set to daviddavis

#3 Updated by daviddavis 6 months ago

  • Sprint set to Sprint 60

Adding to sprint since the PoC is being merged.

#4 Updated by daviddavis 6 months ago

  • Status changed from POST to MODIFIED

#5 Updated by bmbouter 4 months ago

  • Sprint/Milestone set to 3.0.0

#6 Updated by bmbouter 4 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF