forked from Github-Mirrors/canaille
chore: enable flake8-bugbear ruff rules
This commit is contained in:
parent
64885cfefd
commit
a012814eca
3 changed files with 6 additions and 3 deletions
|
@ -132,8 +132,10 @@ def toml_content(file_path):
|
|||
with open(file_path, "rb") as fd:
|
||||
return tomllib.load(fd)
|
||||
|
||||
except ImportError:
|
||||
raise Exception("toml library not installed. Cannot load configuration.")
|
||||
except ImportError as exc:
|
||||
raise Exception(
|
||||
"toml library not installed. Cannot load configuration."
|
||||
) from exc
|
||||
|
||||
|
||||
def setup_config(app, config=None, test_config=True, env_file=".env", env_prefix=""):
|
||||
|
|
|
@ -264,7 +264,7 @@ class LDAPBackend(Backend):
|
|||
|
||||
class_filter = (
|
||||
"".join([f"(objectClass={oc})" for oc in model.ldap_object_class])
|
||||
if getattr(model, "ldap_object_class")
|
||||
if model.ldap_object_class
|
||||
else ""
|
||||
)
|
||||
if class_filter:
|
||||
|
|
|
@ -170,6 +170,7 @@ exclude_lines = [
|
|||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"B", # flake8-bugbear
|
||||
"E", # pycodestyle
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
|
|
Loading…
Reference in a new issue