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

Fixing reverse for form_submitted() #286

Closed
wants to merge 2 commits into from

Conversation

handelaar
Copy link
Contributor

Using django.http.HTTP.HttpResponseRedirect() and django.urls.reverse()

Would fix #285 (does for me anyway)

Using django.http.HTTP.HttpResponseRedirect() and django.urls.reverse()
@dracos dracos added the Current label Feb 22, 2017
@handelaar
Copy link
Contributor Author

Fixed the travis error for Flake8. Remaining problems with checks are.... a bit old.

@dracos
Copy link
Member

dracos commented Feb 23, 2017

All django.shortcuts.redirect does is call reverse, as you can see at https://github.com/django/django/blob/master/django/shortcuts.py#L150
So I would assume that doing nothing but changing 'mapit.views.postcodes.postcode' to 'mapit-postcode' would also fix the issue, and not have any older-Django-version issues :) I have now found in the Django 1.10 release notes: "The ability to reverse() URLs using a dotted Python path is removed." so that's the issue.

It would be good to have a test added showing that this fails in 1.10/11 – Travis automatically runs the tests on 1.8-1.11. Django 1.8 is supported until early 2018, and so we support it also.

@handelaar handelaar closed this Feb 23, 2017
@handelaar handelaar deleted the patch-1 branch February 23, 2017 12:52
@dracos dracos removed the Current label Feb 23, 2017
handelaar added a commit to handelaar/mapit that referenced this pull request Feb 23, 2017
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.

Redirect error from front page postcode form
2 participants