Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jan 30, 2024
1 parent de8d677 commit d5e1060
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions r8/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The public API of r8 that is exposed to challenges.
"""

import sqlite3
from collections.abc import Mapping
from typing import Any
Expand Down
6 changes: 3 additions & 3 deletions r8/challenge_mixins/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def log_nonsafe(request: web.Request) -> bool:

class WebServerChallenge(r8.Challenge):
runner: web.AppRunner = None
log_web_requests: Union[
bool, Callable[[web.Request], bool]
] = lambda self, x: log_nonstatic(x)
log_web_requests: Union[bool, Callable[[web.Request], bool]] = (
lambda self, x: log_nonstatic(x)
)

@property
@abc.abstractmethod
Expand Down
24 changes: 12 additions & 12 deletions r8/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ async def get_challenges(user: str):
challenge["title"] = challenge["cid"]
challenge["visible"] = True
challenge["tags"] = []
challenge[
"description"
] = f"<pre>{html.escape(traceback.format_exc())}</pre>"
challenge["description"] = (
f"<pre>{html.escape(traceback.format_exc())}</pre>"
)
continue

try:
Expand All @@ -659,28 +659,28 @@ async def get_challenges(user: str):
except Exception:
challenge["visible"] = True
challenge["tags"] = []
challenge[
"description"
] = f"<pre>{html.escape(traceback.format_exc())}</pre>"
challenge["description"] = (
f"<pre>{html.escape(traceback.format_exc())}</pre>"
)
continue

try:
challenge["tags"] = [str(x) for x in inst.tags]
except Exception:
challenge["tags"] = []
challenge[
"description"
] = f"<pre>{html.escape(traceback.format_exc())}</pre>"
challenge["description"] = (
f"<pre>{html.escape(traceback.format_exc())}</pre>"
)
continue

try:
challenge["description"] = await inst.description(
user, bool(challenge["solve_time"])
)
except Exception:
challenge[
"description"
] = f"<pre>{html.escape(traceback.format_exc())}</pre>"
challenge["description"] = (
f"<pre>{html.escape(traceback.format_exc())}</pre>"
)

challenge["points"] = scoring.challenge_points(inst, challenge["solves"])

Expand Down

0 comments on commit d5e1060

Please sign in to comment.