From 058b94c71ed27240f98e4c0d68d5242e6f783d04 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Fri, 8 Mar 2024 12:34:53 +0100 Subject: [PATCH] lint: flake8 --- .flake8 | 4 ++++ regex_redirects/actions.py | 1 - regex_redirects/tests.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..03d67fa --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-line-length=88 +exclude=env,.tox,doc +ignore=E203,W503,E501 diff --git a/regex_redirects/actions.py b/regex_redirects/actions.py index 1caf134..1c5ec16 100644 --- a/regex_redirects/actions.py +++ b/regex_redirects/actions.py @@ -26,7 +26,6 @@ def export_as_csv(modeladmin, request, queryset): opts = modeladmin.model._meta field_names = set([field.name for field in opts.fields]) if fields: - fieldset = set(fields) field_names = fields elif exclude: excludeset = set(exclude) diff --git a/regex_redirects/tests.py b/regex_redirects/tests.py index 591e4d3..7461969 100644 --- a/regex_redirects/tests.py +++ b/regex_redirects/tests.py @@ -52,7 +52,7 @@ def test_redirect_with_append_slash_and_query_string(self): def test_regular_expression(self): redirect = Redirect.objects.create( - old_path="/news/index/(\d+)/(.*)/", + old_path=r"/news/index/(\d+)/(.*)/", new_path="/my/news/$2/", regular_expression=True, )