Add default content guard auto-assignment for distributions within a domain - #7992
Open
dkliban wants to merge 1 commit into
Open
Add default content guard auto-assignment for distributions within a domain#7992dkliban wants to merge 1 commit into
dkliban wants to merge 1 commit into
Conversation
Add a default_content_guard field to the Domain model that is automatically assigned to new distributions created within the domain when they do not specify their own content guard. Use a composite content guard as the default to apply multiple guards. Closes: pulp#7988 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dkliban
force-pushed
the
issue-7988/default-content-guard
branch
from
August 19, 2026 00:23
0521ec5 to
f3d180c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
default_content_guardfield to the Domain model. When a distribution is created within a domain that has adefault_content_guardset and the distribution does not specify its own content guard, the domain's default is automatically assigned. To apply multiple guards by default, set a composite content guard as the domain'sdefault_content_guard.Changes
Domain.default_content_guardforeign key (nullable, on_delete=SET_NULL) + migrationDistributionBEFORE_CREATE hook auto-assigns the domain default when no guard is specified (an explicit content guard always wins)DomainSerializerexposes the field (plus a_prnconvenience field) and validates that the guard belongs to the same domainDomainViewSetselect_related to avoid N+1 on listTests
Closes: #7988
🤖 Generated with Claude Code