Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherit trailing_slash attribute from parent router #116

Merged
merged 1 commit into from
Apr 30, 2018

Conversation

Hooksie
Copy link
Contributor

@Hooksie Hooksie commented Apr 29, 2018

Resolves #115

When trailing_slash is not explicitly given on a NestedRouter interface, we copy the trailing_slash attribute from the parent.

There is some care taken to avoid just passing a True or False into the parent constructer, because it limits the ability to inherit all possible values. (Plus it avoids the need to do a roundabout truthiness inspection on the parent's trailing_slash, because the external interface is boolean instead of the internal storage which is a string.)

Had to write a little helper for the tests because URLs change across Django versions. I think I caught all the cases that matter. (It passes tox tests for all django versions using py36, which is all i ran).

@Hooksie
Copy link
Contributor Author

Hooksie commented Apr 29, 2018

amended to fix a flake8 violation

@c17r
Copy link
Collaborator

c17r commented Apr 29, 2018

LGTM

@alanjds alanjds merged commit 5e22a6f into alanjds:master Apr 30, 2018
@alanjds
Copy link
Owner

alanjds commented Apr 30, 2018

Thanks for the fix.

@razvanbretoiu razvanbretoiu mentioned this pull request Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants