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

Canceling adding/editing a location does not work #719

Closed
seav opened this issue Sep 23, 2016 · 4 comments · Fixed by #720 or #819
Closed

Canceling adding/editing a location does not work #719

seav opened this issue Sep 23, 2016 · 4 comments · Fixed by #720 or #819

Comments

@seav
Copy link
Contributor

seav commented Sep 23, 2016

Steps to reproduce the error

Adding a location:

  1. Start adding a location.
  2. Click "Save" without adding geometry to force an error.
  3. Click "Cancel".

Editing a location:

  1. Start editing a location.
  2. Delete the geometry by using the "delete" map function.
  3. Click "Save" to show the error.
  4. Click "Cancel".

Actual behavior

The cancel button brings you to the same add/edit page.

Expected behavior

When editing, cancel should bring you to the location detail page. When adding, cancel should bring you to where you were when you brought up the add location feature, or to the project dashboard.

Cause

This is caused by setting the HTTP referrer to the cancel button. When you get an error, the HTTP referrer is the add/edit location page.

@seav
Copy link
Contributor Author

seav commented Oct 5, 2016

So half of this bug is fixed (canceling editing a location), but the remaining half (canceling adding a location) isn't. The problem is that we can add a location from practically anywhere in the project due to the big "Add location" button in the project header. The decision now is: when the user cancels adding a location, do we (1) put the user back to page where they clicked the "Add location" button by storing the HTTP referrer somehow, or (2) put the user to the project dashboard page, ignoring the HTTP referrer?

@clash99
Copy link
Contributor

clash99 commented Oct 5, 2016

I think the HTTP referrer would be helpful so that the user isn't losing their context.

@seav seav self-assigned this Oct 6, 2016
@seav
Copy link
Contributor Author

seav commented Oct 6, 2016

OK. If there are no objections, I'll try to see if I can somehow store the HTTP referrer when the page is first rendered so that if adding the location encounters errors, we still maintain that HTTP referrer as the URL for the "Cancel" link all throughout.

@seav
Copy link
Contributor Author

seav commented Oct 10, 2016

Status: I currently have working code for this in a branch (bugfix/#719), but it currently has a workaround for a limitation in django-skivvy, which I've already filed as an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment