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
ashleyredzko opened this issue Jun 10, 2015 · 4 comments
Closed

Keeping values in browsable api on error #3024

ashleyredzko opened this issue Jun 10, 2015 · 4 comments

Comments

@ashleyredzko
Copy link

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

Yup clearly an issue that's worth addressing.

@jpadilla
Copy link
Member

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

@jpadilla
Copy link
Member

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

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