Skip to content

Commit

Permalink
importlib: fix "field" possibly unbound
Browse files Browse the repository at this point in the history
  • Loading branch information
agraul committed Jul 25, 2024
1 parent 65e9b90 commit edf402b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/spacewalk/server/importlib/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,11 +1201,13 @@ def update_channels_affected_by_errata(self, dml):
affected_errata_ids = {}
for op_type in ["insert", "update", "delete"]:
op_values = getattr(dml, op_type)
for table_name, values_hash in list(op_values.items()):
for table_name, values_hash in op_values.items():
if table_name == "rhnErrata":
field = "id"
elif "errata_id" in values_hash:
field = "errata_id"
else:
continue

# Now we know in which field to look for changes
for erratum_id in values_hash[field]:
Expand Down

0 comments on commit edf402b

Please sign in to comment.