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

Allow multiple dashes in section names #836

Merged
merged 1 commit into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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