Skip to content

Commit

Permalink
Remove erroneous space in specification
Browse files Browse the repository at this point in the history
  • Loading branch information
felixschndr committed Jan 26, 2025
1 parent 0b72c5c commit 60f0a52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/ingredient.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ def _get_name(raw_data: dict) -> str:
def _get_specification(raw_data: dict) -> str:
specification = f"{Ingredient._get_quantity(raw_data)}{Ingredient._get_unit(raw_data)}"
note = Ingredient._get_note(raw_data)
specification += note if specification == "" else f" {note}"
return specification
if specification == "" and note == "":
return ""
if specification == "":
return note
if note == "":
return specification
return f"{specification} {note}"

@staticmethod
def _get_quantity(raw_data: dict) -> str:
Expand Down

0 comments on commit 60f0a52

Please sign in to comment.