datamade / django-councilmatic

:heartpulse: Django app providing core functions for *.councilmatic.org
http://councilmatic.org
MIT License
26 stars 16 forks source link

Migration to unmangle bill identifiers #190

Closed reginafcompton closed 6 years ago

reginafcompton commented 6 years ago

This PR handles https://github.com/datamade/scrapers-us-municipal/issues/12.

This solution adds migrations to account for mangled NYC and Chicago bills: (1) that are missing leading zeroes, e.g., Res 43-2002 (mangled) vs. Res 0043-2002 (original)

(2) that are missing a space, e.g., T 2018-0369 (mangled) vs. T2018-0369 (original)

The migration unmangles the identifier and changes the slug accordingly, using the django slugify function, e.g., cl-2018-483 (old slug with new identifier of CL2018-483) becomes cl2018-483.