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

@@ -372,15 +372,13 @@ class IPAddressImportForm(PrimaryModelImportForm):
# Make sure is_primary is None when it's not included in the uploaded data
if 'is_primary' not in self.data:
return None
else:
return self.cleaned_data['is_primary']
return self.cleaned_data['is_primary']
def clean_is_oob(self):
# Make sure is_oob is None when it's not included in the uploaded data
if 'is_oob' not in self.data:
return None
else:
return self.cleaned_data['is_oob']
return self.cleaned_data['is_oob']
def clean(self):
super().clean()