banktransfer import: Fix prefix confusion if shorter event name contains dash (Z#23234167) (#6189)

Co-authored-by: luelista <weller@rami.io>
This commit is contained in:
pajowu
2026-05-21 13:03:30 +02:00
committed by GitHub
parent f37dfbd21a
commit dd29063a84
2 changed files with 54 additions and 1 deletions

View File

@@ -405,7 +405,7 @@ def process_banktransfers(self, job: int, data: list) -> None:
# We need to sort prefixes by length with long ones first. In case we have an event with slug
# "CONF" and one with slug "CONF2022", we want CONF2022 to match first, to avoid the parser
# thinking "2022" is already the order code.
"|".join(sorted([re.escape(p).replace("\\-", r"[\- ]*") for p in prefixes], key=lambda p: len(p), reverse=True)),
"|".join([re.escape(p).replace("\\-", r"[\- ]*") for p in sorted(prefixes, key=lambda p: len(p), reverse=True)]),
min(code_len_agg['min'] or 1, inr_len_agg['min'] or 1),
max(code_len_agg['max'] or 5, inr_len_agg['max'] or 5)
)