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

Render None as empty string #41

Conversation

oliverroick
Copy link
Member

Why I made this change

If you add or edit a party on the platform and leave non-required fields blank, number and date fields , which are blank, are displayed as None.

The render method of each attribute simply returns the value passed to the val parameter; for None values this results in "None" being displayed.

Description of the change

If the provided value is None return an empty string ('')

How someone else can test the change

Install this branch in the platform.

Create a project using this form. The form contains an integer field called number_children and a date field called dob.

Create a party, choose the party type "Individual" leave both number_children and dob blank. After saving you should check on the party detail page that no value is displayed for both fields.

When should this PR be merged

This is somewhat urgent to one partner so we need to get it through quickly.

Risks

None

Follow-up actions

  • Release a new version of django-jsonattrs
  • Update the platform requirements to that new version

@oliverroick oliverroick requested a review from alukach June 1, 2018 12:35
@oliverroick oliverroick merged commit 39698bf into master Jun 4, 2018
@oliverroick oliverroick deleted the oroick/ch261/blank-fields-show-the-value-none-on-the-website branch June 4, 2018 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants