Skip to content

Commit

Permalink
Simplify double-negative constructions in check
Browse files Browse the repository at this point in the history
Co-authored-by: Kurt McKee <contactme@kurtmckee.org>
  • Loading branch information
ada-globus and kurtmckee authored Aug 6, 2023
1 parent 5c180fd commit ce90eb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ def __init__(
self.extra_fields = extra or {}

# Enforce that the error contains at least one of the fields we expect
if not any(
(getattr(self, field_name) is not None)
for field_name in self.SUPPORTED_FIELDS.keys()
if all(
getattr(self, field_name) is None
for field_name in self.SUPPORTED_FIELDS
):
raise ValueError(
"Must include at least one supported authorization parameter: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def __init__(
self.extra_fields = extra or {}

# Enforce that the error contains at least one of the fields we expect
if not any(
(getattr(self, field_name) is not None)
for field_name in self.SUPPORTED_FIELDS.keys()
if all(
getattr(self, field_name) is None
for field_name in self.SUPPORTED_FIELDS
):
raise ValueError(
"Must include at least one supported authorization parameter: "
Expand Down

0 comments on commit ce90eb8

Please sign in to comment.