Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #836 from cfpb/multiple-dashes-in-sections
Browse files Browse the repository at this point in the history
Allow multiple dashes in section names
  • Loading branch information
chosak authored Nov 6, 2017
2 parents 0c4ca9a + 389ff03 commit 41bc0d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions regulations/tests/urls_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ def test_diff_url(self):
args=('201-2', '2011-1738_20121011', '2012-22345_20131022'))
self.assertEqual(
r, '/diff/201-2/2011-1738_20121011/2012-22345_20131022')

def test_diff_url_supports_multiple_dashes(self):
r = reverse(
'chrome_section_diff_view',
args=('201-Interp-XYZ', '2011-1738', '2012-22345'))
self.assertEqual(r, '/diff/201-Interp-XYZ/2011-1738/2012-22345')
2 changes: 1 addition & 1 deletion regulations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
notice_pattern = meta_version % 'notice_id'

reg_pattern = r'(?P<label_id>[\d]+)'
section_pattern = r'(?P<label_id>[\d]+[-][\w]+)'
section_pattern = r'(?P<label_id>[\d]+[-][\w-]+)'
interp_pattern = r'(?P<label_id>[-\d\w]+[-]Interp)'
paragraph_pattern = r'(?P<label_id>[-\d\w]+)'
subterp_pattern = r'(?P<label_id>[\d]+-(Appendices|Subpart(-[A-Z]+)?)-Interp)'
Expand Down

0 comments on commit 41bc0d4

Please sign in to comment.