Skip to content

Commit

Permalink
fix: 별칭에 띄어쓰기 허용
Browse files Browse the repository at this point in the history
  • Loading branch information
2jun0 committed Mar 12, 2024
1 parent d7f80af commit c94045f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aws_lambdas/database_lambda/game/model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ def _update_aliases(session: Session, game: Game, aliases: set[str]):
game.aliases.append(GameAlias(name=alias_name))


def _allow_alias_name(alias_name: str):
return all(c == " " or is_aldecimal(c) for c in alias_name)


def to_models(session: Session, games: Iterable[SaveGame]) -> list[Game]:
models = _create_models(session, games)
_attach_models(session, models)

for game in games:
model = models[game["steam_id"]]
aliases = set(alias_name.lower() for alias_name in game["aliases"] if is_aldecimal(alias_name))
aliases = set(alias_name.lower() for alias_name in game["aliases"] if _allow_alias_name(alias_name))
_update_aliases(session, model, aliases)

return list(models.values())

0 comments on commit c94045f

Please sign in to comment.