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

Conversation

chosak
Copy link
Member

@chosak chosak commented Nov 6, 2017

This commit modifies the expected URL pattern for reg section labels so that instead of supporting only e.g. "1005-a" it also supports sections like "1005-a-interp". This fixes some 500 errors that were being generated due to a "1005-Appendices-Interp" section in Reg E.

You can confirm that this works to view diffs in the most recent Reg E content in regulations-stub by hitting this URL locally:

http://localhost:8000/eregulations/diff/1005-2/2016-24506/2016-24503_20181001?from_version=2016-24506#1005-2-a

The section label is passed around the code in various places so it's possible that adding this flexibility might break something else downstream. All current unit tests pass with this change (python manage.py test), however, so I'd rather enable this (which seems like a reasonable assumption, unless there's some section naming guidelines somewhere that are being violated) and handle errors as they come up.

This commit modifies the expected URL pattern for reg section labels so
that instead of supporting only e.g. "1005-a" it also supports sections
like "1005-a-interp". This fixes some 500 errors that were being
generated due to a "1005-Appendices-Interp" section in Reg E.

You can confirm that this works to view diffs in the most recent Reg E
content in regulations-stub by hitting this URL locally:

http://localhost:8000/eregulations/diff/1005-2/2016-24506/2016-24503_20181001?from_version=2016-24506#1005-2-a

The section label is passed around the code in various places so it's
possible that adding this flexibility might break something else
downstream. All current unit tests pass with this change, however, so
I'd rather enable this (which seems like a reasonable assumption, unless
there's some section naming guidelines somewhere that are being
violated) and handle errors as they come up.
@chosak chosak merged commit 41bc0d4 into master Nov 6, 2017
@chosak chosak deleted the multiple-dashes-in-sections branch November 6, 2017 18:12
chosak added a commit that referenced this pull request Nov 9, 2017
This change fixes a bug introduced by #836 that incorrectly passed
section views to subterp views. It restores the previous section pattern
and introduces a new section_or_subterp pattern that's used only for
diff URLs.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants