Skip to content

Commit

Permalink
Always set the value of t before using t
Browse files Browse the repository at this point in the history
  • Loading branch information
bakert committed May 2, 2024
1 parent 3a3c665 commit 6ed128d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions find/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,7 @@ def format_where(term: str) -> str:
if season_code == seasons.ALL:
format_ids = db().values("SELECT id FROM format WHERE name LIKE 'Penny Dreadful%%'")
else:
if season_code:
t = f'Penny Dreadful {season_code}'
t = f'Penny Dreadful {season_code}' if season_code else term
format_ids = db().values('SELECT id FROM format WHERE name LIKE %s', [f'{card.unaccent(t)}%%'])
if not format_ids:
raise InvalidValueException(f"Invalid format '{term}'")
Expand Down

0 comments on commit 6ed128d

Please sign in to comment.