Apply ruff fixes
This commit is contained in:
1 parent
413e9e8381
commit
b7c4b05150
25 files changed
+123
-106
No files matched your search
@@ -19,12 +19,12 @@ from app.models.manufacturer import Manufacturer
|
||||
from app.models.part_colour import PartColour
|
||||
from app.models.part_type import PartType
|
||||
from app.models.permission import Permission
|
||||
from app.models.refresh_token import RefreshToken
|
||||
from app.models.role import Role
|
||||
from app.models.scope_info import ScopeInfo
|
||||
from app.models.scope_model import ScopeModel
|
||||
from app.models.static_connection import StaticConnection
|
||||
from app.models.sub_part_type import SubPartType
|
||||
from app.models.refresh_token import RefreshToken
|
||||
from app.models.role import Role
|
||||
from app.models.unc_thread import UncThread
|
||||
from app.models.user import User
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from app.core.database import Base
|
||||
|
||||
|
||||
class FitLabel(str, enum.Enum):
|
||||
class FitLabel(enum.StrEnum):
|
||||
POSSIBLE = "possible"
|
||||
EXACT = "exact"
|
||||
NONE = "none"
|
||||
|
||||
@@ -6,7 +6,7 @@ from sqlalchemy.orm import Mapped, mapped_column
|
||||
from app.core.database import Base
|
||||
|
||||
|
||||
class UncSeries(str, enum.Enum):
|
||||
class UncSeries(enum.StrEnum):
|
||||
UNC = "UNC"
|
||||
UNF = "UNF"
|
||||
UNEF = "UNEF"
|
||||
|
||||
@@ -7,7 +7,6 @@ successful profile is provisioned locally on first sign-in.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from fastapi.concurrency import run_in_threadpool
|
||||
@@ -43,7 +42,7 @@ def _bind_and_fetch(username: str, password: str) -> LdapIdentity | None:
|
||||
)
|
||||
try:
|
||||
conn = ldap3.Connection(server, user=user_dn, password=password, auto_bind=True)
|
||||
except LDAPException as e:
|
||||
except LDAPException:
|
||||
logging.exception("Failed to log into LDAP for user %s", user_dn)
|
||||
# Wrong credentials, unreachable server, or a refused bind.
|
||||
return None
|
||||
|
||||
Reference in new issue
Block a user