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

Use reverse so more redirects work when MapIt is mounted on a subpath #228

Merged
merged 1 commit into from
Apr 5, 2016

Conversation

mhl
Copy link
Contributor

@mhl mhl commented Feb 23, 2016

If you've included MapIt in another Django project, e.g. with:

urlpatterns += patterns('',
    (r'^mapit/', include('mapit.urls')),
)

... then some of the views that returned a redirect to a URL
constructed with string formatting would redirect to a path
that didn't include the 'mapit/' prefix. If these paths are
constructed with reverse() instead, it works properly.

This also introduces some new URL pattern names, so the URL
patterns can be referred to more concisely.

@dracos
Copy link
Member

dracos commented Mar 1, 2016

👍

@dracos dracos added Reviewed and removed Reviewing labels Mar 1, 2016
If you've included MapIt in another Django project, e.g. with:

    urlpatterns += patterns('',
        (r'^mapit/', include('mapit.urls')),
    )

... then some of the views that returned a redirect to a URL
constructed with string formatting would redirect to a path
that didn't include the 'mapit/' prefix.  If these paths are
constructed with reverse() instead, it works properly.

This also introduces some new URL pattern names, so the URL
patterns can be referred to more concisely.
@mhl mhl force-pushed the more-redirects-using-reverse branch from 8a643aa to d692d27 Compare April 5, 2016 10:09
@mhl mhl merged commit d692d27 into master Apr 5, 2016
@dracos dracos removed the Reviewed label Apr 5, 2016
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.

2 participants