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

It's not possible to remove the URL for an organization or a project #537

Closed
seav opened this issue Aug 9, 2016 · 6 comments
Closed

It's not possible to remove the URL for an organization or a project #537

seav opened this issue Aug 9, 2016 · 6 comments

Comments

@seav
Copy link
Contributor

seav commented Aug 9, 2016

Steps to reproduce the error

  1. Have an organization or project with a URL (either by creating a new entity or editing an existing entity, if there is no entity yet with a URL).
  2. Edit that organization or project to leave the URL field blank. Save.
  3. Notice that the organization or project overview page still displays a URL.
  4. Go to the organization or project's edit details page.
  5. Notice that the URL is still present.

Actual behavior

See steps 3 and 5 above.

Expected behavior

It is expected that there is no URL displayed in the overview page, and editing it shows up blank.

Notes

Based on my testing and Googling, it seems that the SimpleArrayField and SplitArrayField form fields cannot be made to set their corresponding ArrayField model field back to empty once it has some data.

@seav seav added the bug label Aug 9, 2016
@seav seav added this to the Sprint 7 milestone Aug 9, 2016
@seav
Copy link
Contributor Author

seav commented Aug 10, 2016

I have investigated this issue and had to go through Django's innards. It seems the problem is more general and I believe this issue can be fixed by upgrading to Django 1.10 (released last August 1).

The root cause is that in BaseModelForm._post_clean(), the construct_instance() function is being called with the wrong exclude parameter. (The correct value is the list of fields that are excluded in the ModelForm's Meta class; the wrong value is the list of fields that should not be validated anymore at the model level.) This issue is described in Django's ticket #25349 (apparently, this bug was a regression in 1.8) and has been fixed in Django 1.10.

@wonderchook
Copy link
Contributor

@seav I don't think we should upgrade Django for this Sprint 7 release, so I'm going to move it to Sprint 8.

@seav
Copy link
Contributor Author

seav commented Dec 6, 2016

It seems that after upgrading to Django 1.9.11 (or even 1.9.10), this issue has been fixed. I can now clear out the URL for organizations and projects.

@seav seav closed this as completed Dec 6, 2016
@seav seav removed the in progress label Dec 6, 2016
@oliverroick
Copy link
Member

Doesn't work on staging.

@oliverroick oliverroick reopened this Dec 6, 2016
@seav
Copy link
Contributor Author

seav commented Dec 6, 2016

That's weird. It indeed doesn't work now. But I'm sure it worked with v1.3.0-alpha.1. I wonder what changed.

@oliverroick
Copy link
Member

Resolved with upgrade to Django 1.10

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

4 participants