diff --git a/src/pwncore/routes/ctf/__init__.py b/src/pwncore/routes/ctf/__init__.py index 695ab89..cb44d86 100644 --- a/src/pwncore/routes/ctf/__init__.py +++ b/src/pwncore/routes/ctf/__init__.py @@ -109,7 +109,7 @@ async def flag_post( if not team_container: return {"msg_code": config.msg_codes["container_not_found"]} - if team_container.flag == flag.flag: + if team_container.flag == flag.flag.strip(): hints = await Hint.filter( problem_id=ctf_id, viewedhints__team_id=team_id, diff --git a/src/pwncore/routes/team.py b/src/pwncore/routes/team.py index 2a0ca08..8de1039 100644 --- a/src/pwncore/routes/team.py +++ b/src/pwncore/routes/team.py @@ -49,7 +49,7 @@ async def get_self_team(jwt: RequireJwt): team_model = await Team.get(id=team_id).prefetch_related("meta_team") team = dict(await Team_Pydantic.from_tortoise_orm(team_model)) - team["meta_team__name"] = team_model.meta_team.name # type: ignore[arg-type, union-attr] + team["meta_team__name"] = getattr(team_model.meta_team, "name", None) # Get points from leaderboard # would be better is cache stores the values in a dict indexed by team id # for leaderboard_team in gcache.data: