Skip to content
Draft
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
2 changes: 1 addition & 1 deletion pulp_file/tests/functional/api/test_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import uuid

import pytest
from django.conf import settings

from pulpcore.app import settings
from pulpcore.tests.functional.utils import download_file, generate_iso

pytestmark = pytest.mark.skipif(not settings.DOMAIN_ENABLED, reason="Domains not enabled.")
Expand Down
2 changes: 1 addition & 1 deletion pulp_file/tests/functional/api/test_filesystem_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import uuid

import pytest
from django.conf import settings

from pulpcore.app import settings
from pulpcore.client.pulpcore.exceptions import ApiException, BadRequestException
from pulpcore.constants import TASK_STATES

Expand Down
2 changes: 1 addition & 1 deletion pulp_file/tests/functional/api/test_pulp_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pathlib import Path

import pytest
from django.conf import settings

from pulpcore.app import settings
from pulpcore.client.pulpcore.exceptions import ApiException, BadRequestException
from pulpcore.constants import TASK_STATES

Expand Down
2 changes: 1 addition & 1 deletion pulpcore/app/access_policy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from copy import deepcopy

from django.conf import settings
from rest_access_policy import AccessPolicy
from rest_framework.exceptions import APIException

from pulpcore.app import settings
from pulpcore.app.models import AccessPolicy as AccessPolicyModel
from pulpcore.app.util import get_view_urlpattern, get_viewset_for_model

Expand Down
3 changes: 1 addition & 2 deletions pulpcore/app/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from gettext import gettext as _

import jq
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.backends import RemoteUserBackend
from rest_framework.authentication import (
Expand All @@ -16,8 +17,6 @@
)
from rest_framework.exceptions import AuthenticationFailed

from pulpcore.app import settings

_logger = logging.getLogger(__name__)


Expand Down
3 changes: 1 addition & 2 deletions pulpcore/app/redis_connection.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from django.conf import settings
from redis import Redis
from redis.asyncio import Redis as aRedis

from pulpcore.app.settings import settings

_conn = None
_a_conn = None

Expand Down
3 changes: 2 additions & 1 deletion pulpcore/app/serializers/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import re
from gettext import gettext as _

from django.conf import settings
from rest_framework import serializers

from pulpcore.app import models, settings
from pulpcore.app import models
from pulpcore.app.serializers import (
DetailIdentityField,
DetailRelatedField,
Expand Down
3 changes: 2 additions & 1 deletion pulpcore/app/serializers/importer.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
from gettext import gettext as _

from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import serializers

from pulpcore.app import models, settings
from pulpcore.app import models
from pulpcore.app.serializers import (
DetailIdentityField,
DomainUniqueValidator,
Expand Down
3 changes: 2 additions & 1 deletion pulpcore/app/serializers/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from gettext import gettext as _
from urllib.parse import urlparse

from django.conf import settings
from rest_framework import fields, serializers
from rest_framework_nested.serializers import NestedHyperlinkedModelSerializer

from pulpcore.app import models, settings
from pulpcore.app import models
from pulpcore.app.serializers import (
DetailIdentityField,
DetailRelatedField,
Expand Down
4 changes: 2 additions & 2 deletions pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
# List of upload handler classes to be applied in order.
FILE_UPLOAD_HANDLERS = ("pulpcore.app.files.HashingFileUploadHandler",)

# SECURITY WARNING: this should be set to a unique, unpredictable value
SECRET_KEY = "SECRET"
# SECURITY WARNING: this must be set to a unique, unpredictable value.
# SECRET_KEY = "SECRET"

# Key used to encrypt fields in the database
DB_ENCRYPTION_KEY = "/etc/pulp/certs/database_fields.symmetric.key"
Expand Down
2 changes: 1 addition & 1 deletion pulpcore/app/views/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import os
from gettext import gettext as _

from django.conf import settings
from drf_spectacular.utils import extend_schema
from rest_framework.response import Response
from rest_framework.views import APIView

from pulpcore.app import settings
from pulpcore.app.serializers import PulpImportCheckResponseSerializer, PulpImportCheckSerializer


Expand Down
2 changes: 1 addition & 1 deletion pulpcore/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from aiohttp.web import FileResponse, HTTPSuccessful, Request, Response, StreamResponse
from aiohttp.web_exceptions import HTTPFound
from django.conf import settings
from django.http import FileResponse as ApiFileResponse
from django.http import HttpResponse, HttpResponseRedirect
from redis import ConnectionError
Expand All @@ -16,7 +17,6 @@
get_async_redis_connection,
get_redis_connection,
)
from pulpcore.app.settings import settings
from pulpcore.metrics import artifacts_size_counter
from pulpcore.responses import ArtifactResponse

Expand Down
2 changes: 1 addition & 1 deletion pulpcore/tasking/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from django.conf import settings

_bootstrap_servers = settings.get("KAFKA_BOOTSTRAP_SERVERS")
_bootstrap_servers = getattr(settings, "KAFKA_BOOTSTRAP_SERVERS")


if _bootstrap_servers is None:
Expand Down
3 changes: 1 addition & 2 deletions pulpcore/tests/functional/api/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from base64 import b64encode

import pytest

from pulpcore.app import settings
from django.conf import settings


@pytest.mark.parallel
Expand Down
2 changes: 1 addition & 1 deletion pulpcore/tests/functional/api/test_tasking.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import pytest
from aiohttp import BasicAuth
from django.conf import settings

from pulpcore.app import settings
from pulpcore.client.pulpcore import ApiException
from pulpcore.constants import IMMEDIATE_TIMEOUT
from pulpcore.tests.functional.utils import PulpTaskError, download_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from pathlib import Path

import pytest
from django.conf import settings

from pulpcore.app import settings
from pulpcore.client.pulp_file import FileRepositorySyncURL
from pulpcore.client.pulpcore.exceptions import ApiException

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ extend-select = [
[tool.ruff.lint.flake8-tidy-imports.banned-api]
# This section is managed by the plugin template. Do not edit manually.
"distutils".msg = "The 'distutils' module has been deprecated since Python 3.9."
"pulpcore.app.settings".msg = "Always import 'settings' from 'django.conf' instead."

[tool.ruff.lint.isort]
# This section is managed by the plugin template. Do not edit manually.
Expand Down
Loading