Compare commits

..

1 Commits

Author SHA1 Message Date
Jonas Schäfer
d5a46b69a6 Include flake8-print plugin
This alerts us of stray print statements, which should never occur
because this is a non-TUI application.
2022-01-15 17:07:16 +01:00
4 changed files with 3 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ jobs:
- name: Install
run: |
set -euo pipefail
pip install flake8
pip install flake8 flake8-print
- name: Linting
run: |
python -m flake8 snikket_web

View File

@@ -542,8 +542,6 @@ async def edit_circle(id_: str) -> typing.Union[str, quart.Response]:
)
return redirect(url_for(".edit_circle", id_=id_))
else:
print(form.errors)
return await render_template(
"admin_edit_circle.html",

View File

@@ -53,14 +53,11 @@ def circle_name(c: typing.Any) -> str:
def format_bytes(n: float) -> str:
try:
scale = max(math.floor(math.log(n, 1024)), 0)
except ValueError:
scale = 0
scale = math.floor(math.log(n, 1024))
try:
unit = BYTE_UNIT_SCALE_MAP[scale]
factor = 1024**scale
except IndexError:
except ValueError:
unit = "TiB"
factor = 1024**4
if factor > 1:

View File

@@ -138,7 +138,6 @@ async def profile() -> typing.Union[str, quart.Response]:
mimetype = file_info.mimetype
data = file_info.stream.read()
if len(data) > max_avatar_size:
print(len(data), max_avatar_size)
form.avatar.errors.append(EAVATARTOOBIG)
ok = False
elif len(data) > 0: