Fix issue with combine_notes
This commit is contained in:
parent
1cbed64299
commit
c5a5fc8bdb
@ -38,8 +38,8 @@ class UtilsVars:
|
||||
|
||||
|
||||
def combine_notes(existing_notes: str | None, new_notes: str | None, split: str) -> str:
|
||||
split_notes, _, untouched_notes = (existing_notes or "").rpartition(split)
|
||||
if split_notes:
|
||||
split_notes, split_str, untouched_notes = (existing_notes or "").rpartition(split)
|
||||
if split_notes or split_str:
|
||||
return (split_notes + (new_notes or "")).strip()
|
||||
else:
|
||||
return (untouched_notes + "\n" + (new_notes or "")).strip()
|
||||
|
@ -86,6 +86,7 @@ combine_values = [
|
||||
(None, "english", "en", "english"),
|
||||
("hello", "", "en", "hello"),
|
||||
("hello", None, "en", "hello"),
|
||||
("hello", "hello", "hel", "hello"),
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user