From 59255eda5e66fdf73c4bb0c8bb5626a58fbc9301 Mon Sep 17 00:00:00 2001 From: catborise Date: Sat, 26 Sep 2026 15:39:23 +0300 Subject: [PATCH] fix(linter): sort imports for super-linter and narrow spec type for mypy --- console/tests.py | 9 +++++---- console/views.py | 7 +++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/console/tests.py b/console/tests.py index 2fc7bfe1..5d57c928 100644 --- a/console/tests.py +++ b/console/tests.py @@ -4,15 +4,14 @@ import importlib.util from pathlib import Path from unittest.mock import MagicMock, patch +from accounts.models import UserInstance +from computes.models import Compute from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.test import TestCase, override_settings from django.urls import reverse -from libvirt import libvirtError - -from accounts.models import UserInstance -from computes.models import Compute from instances.models import Instance +from libvirt import libvirtError # Dynamically load console/novncd script for testing NOVNCD_PATH = str(Path(__file__).resolve().parent / "novncd") @@ -20,6 +19,8 @@ _loader = importlib.machinery.SourceFileLoader("novncd_mod", NOVNCD_PATH) _spec = importlib.util.spec_from_file_location( "novncd_mod", NOVNCD_PATH, loader=_loader ) +assert _spec is not None +assert _spec.loader is not None novncd_mod = importlib.util.module_from_spec(_spec) _loader.exec_module(novncd_mod) diff --git a/console/views.py b/console/views.py index 1239f6ab..df7ca88b 100644 --- a/console/views.py +++ b/console/views.py @@ -1,15 +1,14 @@ # pylint: disable=no-name-in-module,no-member import re +from accounts.models import UserInstance +from appsettings.settings import app_settings from django.conf import settings from django.http.response import HttpResponseServerError from django.shortcuts import render from django.utils.translation import gettext_lazy as _ -from libvirt import libvirtError - -from accounts.models import UserInstance -from appsettings.settings import app_settings from instances.models import Instance +from libvirt import libvirtError from vrtManager.instance import wvmInstance