fix: keep GUEST/CAST visible in asset names
- clean_customer_name() no longer strips GUEST/CAST suffixes - Re-ran migration: 967 asset names updated with GUEST/CAST preserved - Format: '95301 - Animal Kingdom CAST / address / building' vs previous: '95301 - Animal Kingdom / address / building'
This commit is contained in:
@@ -70,19 +70,17 @@ BUILDING_NAME_MAP = {
|
||||
|
||||
|
||||
def clean_customer_name(raw: str) -> str:
|
||||
"""Clean a customer name for display.
|
||||
"""Clean a customer name for display — keeps GUEST/CAST suffix visible.
|
||||
|
||||
D-All Star Music GUEST → All Star Music Guest
|
||||
D-All Star Music GUEST → All Star Music GUEST
|
||||
Home Depot #0232 Southlan → Home Depot #0232 Southlan
|
||||
"""
|
||||
if not raw:
|
||||
return ""
|
||||
name = raw
|
||||
# Remove D- prefix (Disney identifier)
|
||||
# Remove D- prefix (Disney identifier) only
|
||||
if name.startswith("D-") or name.startswith("D "):
|
||||
name = name[2:]
|
||||
# Remove GUEST/CAST/ROOM suffixes for cleaner display
|
||||
name = re.sub(r'\s+(?:GUEST|CAST|GUEST ROOM|GST|GUEST?)\s*$', '', name, flags=re.I)
|
||||
name = name.strip()
|
||||
return name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user