mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-23 22:39:45 +03:00
Fix/ignore a few new Ruff violations
This commit is contained in:
parent
32073c059f
commit
e9d3dc053a
|
@ -1,4 +1,3 @@
|
|||
# ruff: noqa: E501
|
||||
from .base import * # noqa: F403
|
||||
from .base import INSTALLED_APPS
|
||||
from .base import MIDDLEWARE
|
||||
|
@ -79,7 +78,7 @@ if env("USE_DOCKER") == "yes":
|
|||
import socket
|
||||
|
||||
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
||||
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
|
||||
INTERNAL_IPS += [".".join([*ip.split(".")[:-1], "1"]) for ip in ips]
|
||||
{%- if cookiecutter.frontend_pipeline in ['Gulp', 'Webpack'] %}
|
||||
try:
|
||||
_, _, ips = socket.gethostbyname_ex("node")
|
||||
|
|
|
@ -10,7 +10,7 @@ def main():
|
|||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
from django.core.management import execute_from_command_line # noqa: PLC0415
|
||||
except ImportError as exc:
|
||||
raise ImportError( # noqa: TRY003
|
||||
"Couldn't import Django. Are you sure it's installed and " # noqa: EM101
|
||||
|
|
|
@ -10,4 +10,4 @@ class UsersConfig(AppConfig):
|
|||
|
||||
def ready(self):
|
||||
with contextlib.suppress(ImportError):
|
||||
import {{ cookiecutter.project_slug }}.users.signals # noqa: F401
|
||||
import {{ cookiecutter.project_slug }}.users.signals # noqa: F401, PLC0415
|
||||
|
|
|
@ -60,7 +60,7 @@ class TestUserAdmin:
|
|||
def _force_allauth(self, settings):
|
||||
settings.DJANGO_ADMIN_FORCE_ALLAUTH = True
|
||||
# Reload the admin module to apply the setting change
|
||||
import {{ cookiecutter.project_slug }}.users.admin as users_admin
|
||||
import {{ cookiecutter.project_slug }}.users.admin as users_admin # noqa: PLC0415
|
||||
|
||||
with contextlib.suppress(admin.sites.AlreadyRegistered): # type: ignore[attr-defined]
|
||||
reload(users_admin)
|
||||
|
|
Loading…
Reference in New Issue
Block a user