Skip to content

Commit

Permalink
Switch from not a in to a not in
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Sep 25, 2024
1 parent 5c29d6a commit d36b3a4
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ exclude = [
force-exclude = true

[tool.ruff.lint]
select = ["E711", "E721", "E9", "F541", "F63", "F7", "F81", "F82"]
select = ["E711", "E713", "E721", "E9", "F541", "F63", "F7", "F81", "F82"]

[tool.towncrier]
directory = "changelog.d"
Expand Down
2 changes: 1 addition & 1 deletion python/nav/bin/macwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def prioritize_location(cam_objects):
# that we ignore it for the time.
prioritized_cams = {0: []}
for value in LOCATION_PRIORITY.values():
if not value in prioritized_cams:
if value not in prioritized_cams:
prioritized_cams[value] = []
for curr_cam in cam_objects:
category = curr_cam.netbox.category_id
Expand Down
2 changes: 1 addition & 1 deletion python/nav/ipdevpoll/plugins/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _find_submodules(name):
pyfiles = (
n
for n in os.listdir(directory)
if (n.endswith('.py') or n.endswith('.pyc')) and not n[0] in '_.'
if (n.endswith('.py') or n.endswith('.pyc')) and n[0] not in '_.'
)
names = (os.path.splitext(n)[0] for n in pyfiles)
return ["{}.{}".format(name, n) for n in names]
Expand Down
4 changes: 2 additions & 2 deletions python/nav/web/geomap/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def build_graph(db_results):
# create Edge objects:
for connection in connections.values():
if (
not connection['forward']['local_netboxid'] in graph.nodes
or not connection['reverse']['local_netboxid'] in graph.nodes
connection['forward']['local_netboxid'] not in graph.nodes
or connection['reverse']['local_netboxid'] not in graph.nodes
):
continue
graph.add_edge(
Expand Down
4 changes: 2 additions & 2 deletions python/nav/web/seeddb/utils/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def move(request, model, form_model, redirect, title_attr='id', extra_context=No

# If nothing is selected, don't update
for key in foreign_keys:
if not form.cleaned_data[key] is None:
if form.cleaned_data[key] is not None:
data[key] = form.cleaned_data[key]

# Update
Expand Down Expand Up @@ -139,7 +139,7 @@ def _parse_value_differences(values, data, title_attr, fields):
if data:
new_values = []
for attr in fields:
if not data[attr] is None:
if data[attr] is not None:
new_values.append(("New %s" % attr, data[attr]))
else:
new_values.append(("New %s" % attr, obj[attr]))
Expand Down
2 changes: 1 addition & 1 deletion tools/eventgenerators/moduleevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def main():
box, module = spec.split(":")
cursor.execute(sql, (box, module))
for deviceid, netboxid, moduleid, sysname, modulename in cursor.fetchall():
if not deviceid in device_dupes:
if deviceid not in device_dupes:
netboxes.append((deviceid, netboxid, moduleid))
sysnames.append((sysname, modulename))
device_dupes.add(deviceid)
Expand Down
2 changes: 1 addition & 1 deletion tools/eventgenerators/snmpevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def handler(nblist, state):

database.execute(sql)
for netboxid, sysname, typeid in database.fetchall():
if not netboxid in nbdup:
if netboxid not in nbdup:
nb.append(netboxid)
sysnames.append(sysname)
nbdup.add(netboxid)
Expand Down

0 comments on commit d36b3a4

Please sign in to comment.