Skip to content

Commit a01a205

Browse files
committed
fix(urls): parse hyphens in agency slug paths
TransitAgency.slug is a SlugField and so allows configuring an agency with hyphens in its slug, e.g. simi-valley-transit however the URL path parsing in TransitAgencyPathConverter failed to account for hyphens, leading to an error for agencies so configured, e.g. > Reverse for 'agency_index' with arguments '('simi-valley-transit',)' not found. > 1 pattern(s) tried: ['(?P<agency>[a-zA-Z]{3,})\\Z']
1 parent 9789d4b commit a01a205

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

benefits/core/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TransitAgencyPathConverter:
2626
"""Path converter to parse valid TransitAgency objects from URL paths."""
2727

2828
# used to test the url fragment, determines if this PathConverter is used
29-
regex = "[a-zA-Z]{3,}"
29+
regex = "[a-zA-Z-]{3,}"
3030

3131
def to_python(self, value):
3232
"""Determine if the matched fragment corresponds to an active Agency."""

0 commit comments

Comments
 (0)