import pathlib

p = pathlib.Path('modules/crm/schemas.py')
lines = p.read_text(encoding='utf-8').split(chr(10))
out = []
fixed = 0
for l in lines:
    if 'raise ValueError(f' in l and 'target_type' in l:
        l = "            raise ValueError(f\"target_type must be one of: {', '.join(TARGET_TYPE_CHOICES)}\")"
        fixed += 1
    elif 'raise ValueError(f' in l and 'activity_type' in l:
        l = "            raise ValueError(f\"activity_type must be one of: {', '.join(ACTIVITY_TYPE_CHOICES)}\")"
        fixed += 1
    out.append(l)
p.write_text(chr(10).join(out), encoding='utf-8')
print('fixed=' + str(fixed))
