Skip to content

Commit

Permalink
Fix lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
carltongibson committed Dec 28, 2024
1 parent cd41c81 commit fc0674f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions django_filters/filterset.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ def __init__(self, options=None):

self.form = getattr(options, "form", forms.Form)

behavior = getattr(options, "unknown_field_behavior", UnknownFieldBehavior.RAISE)
behavior = getattr(
options,
"unknown_field_behavior",
UnknownFieldBehavior.RAISE,
)

if not isinstance(behavior, UnknownFieldBehavior):
raise ValueError(f"Invalid unknown_field_behavior: {behavior}")
Expand Down Expand Up @@ -380,7 +384,9 @@ def handle_unrecognized_field(cls, field_name, message):
if behavior == UnknownFieldBehavior.RAISE:
raise AssertionError(message)
elif behavior == UnknownFieldBehavior.WARN:
warnings.warn(f"Unrecognized field type for '{field_name}'. Field will be ignored.")
warnings.warn(
f"Unrecognized field type for '{field_name}'. Field will be ignored."
)
elif behavior == UnknownFieldBehavior.IGNORE:
pass
else:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_widgets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.forms import NumberInput, Select, TextInput
from django.test import TestCase
from django.http import QueryDict
from django.test import TestCase

from django_filters.widgets import (
BaseCSVWidget,
BooleanWidget,
Expand Down

0 comments on commit fc0674f

Please sign in to comment.