Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • arkindex/backend
1 result
Show changes
......@@ -23,7 +23,7 @@ def ask(phrase):
choice = input(phrase + " [y/n]: ")
if choice.lower() == "y":
return True
elif choice.lower() == "n":
if choice.lower() == "n":
return False
......@@ -33,7 +33,7 @@ def choose(instances, name_field="name", title="Pick one item", allow_skip=False
nb = instances.count()
if nb == 0:
return
elif nb == 1:
if nb == 1:
return instances.first()
# Build internal representation
......
......@@ -261,12 +261,11 @@ class PasswordReset(CreateAPIView):
status=status.HTTP_201_CREATED,
headers=headers,
)
else:
return Response(
form.errors.get_json_data(),
status=status.HTTP_400_BAD_REQUEST,
headers=self.default_response_headers
)
return Response(
form.errors.get_json_data(),
status=status.HTTP_400_BAD_REQUEST,
headers=self.default_response_headers
)
@extend_schema_view(post=extend_schema(operation_id="PasswordResetConfirm", tags=["users"]))
......
......@@ -5,8 +5,51 @@ line-length = 120
quote-style = "double"
[lint]
select = ["Q0", "F", "W", "E",
select = [
# flake8-quotes
"Q",
# pyflakes
"F",
# pycodestyle
"W",
"E",
# request-without-timeout
"S113",
# isort
"I",
# flake8-debugger
"T10",
# escape-sequence-in-docstring
"D301",
# flake8-return
"RET",
]
ignore = ["E501", "RET502", "RET503"]
[lint.isort]
default-section = "first-party"
known-third-party = [
"SolrClient",
"bleach",
"boto3",
"botocore",
"cryptography",
"corsheaders",
"django",
"django_admin_hstore_widget",
"django_rq",
"drf_spectacular",
"enumfields",
"gitlab",
"psycopg2",
"requests",
"responses",
"rest_framework",
"rq",
"setuptools",
"sqlparse",
"teklia_toolbox",
"tenacity",
"tripoli",
"yaml",
]
ignore = ["E501"]