fix various issues

This commit is contained in:
Matthias Mair 2026-06-20 14:10:32 +02:00
parent bbfbc78845
commit 6757aa1ab0
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
8 changed files with 10 additions and 11 deletions

View File

@ -115,7 +115,7 @@ invalid-return-type="ignore" # 22 ##
unknown-argument="ignore" # 3 # need to wait for better django field stubs
invalid-argument-type="ignore" # 49
no-matching-overload="ignore" # 3 # need to wait for betterdjango field stubs
possibly-unbound-attribute="ignore" # 21
# possibly-unbound-attribute="ignore" # 21
[tool.coverage.run]
source = ["src/backend/InvenTree", "InvenTree"]

View File

@ -282,7 +282,7 @@ def postprocess_print_stats(result, generator, request, public):
scopes = {}
for path, details in rlt_dict.items():
if details['oauth']:
for scope in details['oauth']:
for scope in list(details['oauth']):
if scope not in scopes:
scopes[scope] = []
scopes[scope].append(path)
@ -343,7 +343,7 @@ def schema_for_view_output_options(view_class):
return extended_view
def exclude_from_schema(klass: type, alternative_path: str) -> type:
def exclude_from_schema(klass: type[Any], alternative_path: str) -> type[Any]:
"""Decorator to exclude a view from the OpenAPI schema.
This is used to hide legacy endpoints from the schema, while still retaining them for backwards compatibility.

View File

@ -9,8 +9,8 @@ def get_ldap_config(debug: bool = False) -> dict:
The returned settings will be updated into the globals() object,
and will be used to configure the LDAP authentication backend.
"""
import django_auth_ldap.config # type: ignore[unresolved-import]
import ldap # type: ignore[unresolved-import]
import django_auth_ldap.config # ty: ignore[unresolved-import]
import ldap # ty: ignore[unresolved-import]
# get global options from dict and use ldap.OPT_* as keys and values
global_options_dict = get_setting(

View File

@ -15,7 +15,7 @@ TESTING = 'test' in sys.argv
def clear():
if not TESTING: # pragma: no cover
os.system('cls' if os.name == 'nt' else 'clear')
os.system('cls' if os.name == 'nt' else 'clear') # ty:ignore[deprecated]
def reverse_association(apps, schema_editor): # pragma: no cover

View File

@ -1021,7 +1021,7 @@ def format_number(
number = float(number)
if multiplier is not None:
number *= multiplier
number *= float(multiplier)
if integer:
number = int(number)

View File

@ -19,7 +19,7 @@ if __name__ == '__main__':
os.mkdir(STATIC_FOLDER)
print('Downloading tabler icons...')
os.system(f'npm install --prefix {TMP_FOLDER} @tabler/icons @tabler/icons-webfont')
os.system(f'npm install --prefix {TMP_FOLDER} @tabler/icons @tabler/icons-webfont') # ty:ignore[deprecated]
print(f'Copying tabler icons to {STATIC_FOLDER}...')

View File

@ -47,9 +47,7 @@ User.add_to_class('__str__', user_model_str) # Overriding User.__str__
if settings.LDAP_AUTH:
from django_auth_ldap.backend import ( # type: ignore[unresolved-import]
populate_user,
)
from django_auth_ldap.backend import populate_user # ty: ignore[unresolved-import]
@receiver(populate_user)
def create_email_address(user, **kwargs):

View File

@ -4,6 +4,7 @@ import json
import os
import pytest
from inventree.api import InvenTreeAPI
server = os.environ.get('INVENTREE_PYTHON_TEST_SERVER', 'http://127.0.0.1:12345')