Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruff: Fix RUF051 #11497

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions dojo/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1951,9 +1951,7 @@ class MetricsFilterForm(forms.Form):

# add the ability to exclude the exclude_product_types field
def __init__(self, *args, **kwargs):
exclude_product_types = kwargs.get("exclude_product_types", False)
if "exclude_product_types" in kwargs:
del kwargs["exclude_product_types"]
exclude_product_types = kwargs.pop("exclude_product_types", False)
super().__init__(*args, **kwargs)
if exclude_product_types:
del self.fields["exclude_product_types"]
Expand Down Expand Up @@ -3208,10 +3206,7 @@ def __init__(self, *args, **kwargs):
self.helper.form_method = "post"

# If true crispy-forms will render a <form>..</form> tags
self.helper.form_tag = kwargs.get("form_tag", True)

if "form_tag" in kwargs:
del kwargs["form_tag"]
self.helper.form_tag = kwargs.pop("form_tag", True)

self.engagement_survey = kwargs.get("engagement_survey")

Expand All @@ -3223,13 +3218,12 @@ def __init__(self, *args, **kwargs):

self.helper.form_class = kwargs.get("form_class", "")

self.question = kwargs.get("question")
self.question = kwargs.pop("question", None)

if not self.question:
msg = "Need a question to render"
raise ValueError(msg)

del kwargs["question"]
super().__init__(*args, **kwargs)


Expand Down
Loading