From 09a48478f7d06669acb670b5dcca02043c72998b Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Tue, 3 Sep 2024 13:06:41 +0200 Subject: [PATCH] Use a scoped mypy type ignore JSONSettings override dict but the signature of get is different. Just silence that type of warning while getting type check for the type of the arguments. --- lms/models/json_settings.py | 2 +- lms/resources/_js_config/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lms/models/json_settings.py b/lms/models/json_settings.py index 5273a04ec8..dbd65960fa 100644 --- a/lms/models/json_settings.py +++ b/lms/models/json_settings.py @@ -72,7 +72,7 @@ class JSONSettings(MutableDict): An optional spec for the acceptable fields and types. """ - def get(self, group, key, default=None): # type: ignore + def get(self, group: str, key: str, default=None): # type: ignore[override] """ Return the requested setting or None. diff --git a/lms/resources/_js_config/__init__.py b/lms/resources/_js_config/__init__.py index ba4e24a699..3294ede0cf 100644 --- a/lms/resources/_js_config/__init__.py +++ b/lms/resources/_js_config/__init__.py @@ -7,7 +7,7 @@ from lms.error_code import ErrorCode from lms.events import LTIEvent from lms.js_config_types import DashboardConfig, DashboardRoutes, User -from lms.models import Assignment, Course, Grouping +from lms.models import ApplicationInstance, Assignment, Course, Grouping from lms.product.blackboard import Blackboard from lms.product.canvas import Canvas from lms.product.d2l import D2L @@ -48,7 +48,7 @@ def _h_user(self): return self._lti_user.h_user @property - def _application_instance(self): + def _application_instance(self) -> ApplicationInstance: return self._lti_user.application_instance def add_document_url( # pylint: disable=too-complex,too-many-branches,useless-suppression # noqa: PLR0912