From ef58614354842494ac708b721f98de25a84896db Mon Sep 17 00:00:00 2001 From: samsmith Date: Fri, 8 Apr 2022 21:23:07 +0100 Subject: [PATCH] Update parse_tables.py if there's a comma in the name at the end, then it is still "surname, firstname" and the bot should be able to fix that --- ynr/apps/sopn_parsing/helpers/parse_tables.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ynr/apps/sopn_parsing/helpers/parse_tables.py b/ynr/apps/sopn_parsing/helpers/parse_tables.py index 616ddde7ca..261c2516e5 100644 --- a/ynr/apps/sopn_parsing/helpers/parse_tables.py +++ b/ynr/apps/sopn_parsing/helpers/parse_tables.py @@ -170,6 +170,11 @@ def clean_name(name): last_names = clean_last_names(names) first_names = " ".join([name for name in names if not name.isupper()]) full_name = f"{first_names} {last_names}".strip() + + commas = re.match("(.*),(.*)",full_name) + if commas: + full_name= " ".join(n[2],n[1]) + return full_name