chore(ruff): Enable RET rules and add explicit fallbacks

Adopt Ruff `RET` to improve return-flow consistency across the codebase.
Simplify control flow by removing redundant `else` blocks after
`return`, and add explicit `return None` (or equivalent) fallbacks
where appropriate to preserve existing behavior.

Fixes #21411
This commit is contained in:
Martin Hauser
2026-02-18 22:22:47 +01:00
committed by Jeremy Stretch
parent b22e490847
commit ef52ac4203
77 changed files with 249 additions and 249 deletions

View File

@@ -1598,7 +1598,7 @@ class InterfaceBulkEditForm(
if not self.cleaned_data['mode']:
if self.cleaned_data['untagged_vlan']:
raise forms.ValidationError({'untagged_vlan': _("Interface mode must be specified to assign VLANs")})
elif self.cleaned_data['tagged_vlans']:
if self.cleaned_data['tagged_vlans']:
raise forms.ValidationError({'tagged_vlans': _("Interface mode must be specified to assign VLANs")})
# Untagged interfaces cannot be assigned tagged VLANs