fix: fix 'unused-variable' for pylint
This commit is contained in:
parent
8987197856
commit
2c2d35554f
9 changed files with 8 additions and 11 deletions
|
@ -11,3 +11,4 @@ enable=
|
|||
too-many-instance-attributes,
|
||||
too-many-return-statements,
|
||||
unused-import,
|
||||
unused-variable,
|
||||
|
|
|
@ -182,7 +182,7 @@ def main(global_config, **settings):
|
|||
``poser.web.app:main``), similar to this one but with additional
|
||||
views and other config.
|
||||
"""
|
||||
wutta_config = make_wutta_config(settings)
|
||||
wutta_config = make_wutta_config(settings) # pylint: disable=unused-variable
|
||||
pyramid_config = make_pyramid_config(settings)
|
||||
|
||||
pyramid_config.include("wuttaweb.static")
|
||||
|
|
|
@ -870,7 +870,6 @@ class Form: # pylint: disable=too-many-instance-attributes
|
|||
generating it automatically if necessary.
|
||||
"""
|
||||
if not hasattr(self, "deform_form"):
|
||||
model = self.app.model
|
||||
schema = self.get_schema()
|
||||
kwargs = {}
|
||||
|
||||
|
|
|
@ -383,7 +383,6 @@ class ObjectRef(colander.SchemaType):
|
|||
return value
|
||||
|
||||
# fetch object from DB
|
||||
model = self.app.model
|
||||
obj = None
|
||||
if isinstance(value, _uuid.UUID):
|
||||
obj = self.session.get(self.model_class, value)
|
||||
|
@ -606,7 +605,7 @@ class Permissions(WuttaSet):
|
|||
|
||||
if "values" not in kwargs:
|
||||
values = []
|
||||
for gkey, group in self.permissions.items():
|
||||
for group in self.permissions.values():
|
||||
for pkey, perm in group["perms"].items():
|
||||
values.append((pkey, perm["label"]))
|
||||
kwargs["values"] = values
|
||||
|
|
|
@ -467,7 +467,7 @@ class PermissionsWidget(WuttaCheckboxChoiceWidget):
|
|||
|
||||
if "values" not in kw:
|
||||
values = []
|
||||
for gkey, group in self.permissions.items():
|
||||
for group in self.permissions.values():
|
||||
for pkey, perm in group["perms"].items():
|
||||
values.append((pkey, perm["label"]))
|
||||
kw["values"] = values
|
||||
|
|
|
@ -605,7 +605,7 @@ def make_json_safe(value, key=None, warn=True):
|
|||
# ensure JSON-compatibility, warn if problems
|
||||
try:
|
||||
json.dumps(value)
|
||||
except TypeError as error:
|
||||
except TypeError:
|
||||
if warn:
|
||||
prefix = "value"
|
||||
if key:
|
||||
|
|
|
@ -285,8 +285,8 @@ class RoleView(MasterView):
|
|||
available = self.wutta_permissions
|
||||
permissions = form.validated["permissions"]
|
||||
|
||||
for gkey, group in available.items():
|
||||
for pkey, perm in group["perms"].items():
|
||||
for group in available.values():
|
||||
for pkey in group["perms"]:
|
||||
if pkey in permissions:
|
||||
auth.grant_permission(role, pkey)
|
||||
else:
|
||||
|
|
|
@ -156,7 +156,7 @@ class AppInfoView(MasterView):
|
|||
return self.config.get(f"wuttaweb.{key}")
|
||||
|
||||
weblibs = self.get_weblibs()
|
||||
for key, title in weblibs.items():
|
||||
for key in weblibs:
|
||||
|
||||
simple_settings.append(
|
||||
{
|
||||
|
|
|
@ -175,7 +175,6 @@ class UserView(MasterView):
|
|||
|
||||
def objectify(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
model = self.app.model
|
||||
auth = self.app.get_auth_handler()
|
||||
data = form.validated
|
||||
|
||||
|
@ -272,7 +271,6 @@ class UserView(MasterView):
|
|||
|
||||
:rtype: :class:`~wuttaweb.grids.base.Grid`
|
||||
"""
|
||||
model = self.app.model
|
||||
route_prefix = self.get_route_prefix()
|
||||
|
||||
grid = self.make_grid(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue