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

Keeping values in browsable api on error #3024

Closed
tredzko opened this issue Jun 10, 2015 · 4 comments
Closed

Keeping values in browsable api on error #3024

tredzko opened this issue Jun 10, 2015 · 4 comments

Comments

@tredzko
Copy link
Contributor

tredzko commented Jun 10, 2015

Values entered in the browsable api list view html form are currently cleared on an error. This means that a user would have to re-enter the entirety of what they put in before. Instead, the values should be kept so the user can remedy the incorrect fields and keep what they have already entered.

Steps to reproduce:

  1. Navigate to browsable api list view page.
  2. Enter some values into the html form fields, but leave some empty or invalid.
  3. Post the form.
  4. Error is produced.

This also occurs on detail view even though the form is already prefilled with information.

@tomchristie
Copy link
Member

tomchristie commented Jun 23, 2015

Yup clearly an issue that's worth addressing.

@jpadilla
Copy link
Member

jpadilla commented Jun 28, 2015

Thinking about tackling this one next. It'd definitely make using the browsable api way better.

@jpadilla
Copy link
Member

jpadilla commented Jul 18, 2015

First attempt at this. This is just making sure we pass data to the serializers used in get_raw_data_form() and get_rendered_html_form(). As you can see the username is missing from the raw data form and is None in the HTML form because since the serializer has an error serializer.data defaults to serializer.get_initial() which excludes fields with empty values. Ideas on how to proceed are welcomed.

screen shot 2015-07-18 at 8 00 42 am

screen shot 2015-07-18 at 8 00 51 am

@tomchristie
Copy link
Member

tomchristie commented Jul 23, 2015

Resolved 😄

@tomchristie tomchristie modified the milestones: 3.1.4 Release, 3.2.0 Release Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants