Skip to content

Commit

Permalink
fix: strip keys before querying
Browse files Browse the repository at this point in the history
  • Loading branch information
Crissium committed Aug 16, 2024
1 parent cc1dfc2 commit 2de1954
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/app/dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,15 @@ def lookup(self, dictionary_name: str, key: str) -> str:
"""
Returns HTML article
"""
key = key.strip()
self.settings.add_to_history(key)
return self._dictionaries[dictionary_name].get_definition_by_key(key)

def query(self, group_name: str, key: str) -> list[tuple[str, str, str]]:
"""
Returns a list of tuples (dictionary name, dictionary display name, HTML article)
"""
key = key.strip()
key_simplified = simplify(key)
names_dictionaries_of_group = self.settings.dictionaries_of_group(group_name)
group_lang = self.settings.group_lang(group_name)
Expand Down

0 comments on commit 2de1954

Please sign in to comment.