Skip to content

Commit c2ba346

Browse files
authored
fix: restore lazy PyPIMixin import to prevent circular import crash (#1232)
The top-level import of PyPIMixin introduced in #1231 causes a circular import at startup: DRF settings → DomainBasedPermission → pulp_python views → rest_framework.viewsets → (circular). This crashes all API pods with CrashLoopBackOff. Restore the lazy import inside has_permission() where it was originally. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 887d255 commit c2ba346

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pulp_service/pulp_service/app/authorization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from pulpcore.plugin.models import Domain
1212
from pulpcore.plugin.util import extract_pk, get_domain_pk
1313

14-
from pulp_python.app.pypi.views import PyPIMixin
15-
1614
from pulp_service.app.models import DomainOrg
1715

1816
_logger = logging.getLogger(__name__)
@@ -52,6 +50,8 @@ def has_permission(self, request, view):
5250

5351
# Allow safe requests on PyPI views and public domains for all users
5452
if request.method in SAFE_METHODS:
53+
from pulp_python.app.pypi.views import PyPIMixin
54+
5555
if isinstance(view, PyPIMixin):
5656
return True
5757
domain = getattr(request, "pulp_domain", None)

0 commit comments

Comments
 (0)