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

ValueError: list.remove(x): x not in list - Incompatibility with newest django-rest-framework 3.10.2 #194

Closed
ChrFr opened this issue Aug 8, 2019 · 0 comments

Comments

@ChrFr
Copy link

ChrFr commented Aug 8, 2019

ValueError: list.remove(x): x not in list

The newest version of django-rest-framework handles the fields attribute differently
https://github.com/encode/django-rest-framework/blob/master/rest_framework/serializers.py#L352
It now returns a new copy of the field dict with every call, causing problems in the django-rest-framework-gis code at
https://github.com/djangonauts/django-rest-framework-gis/blob/master/rest_framework_gis/serializers.py#L107
when trying to remove the id field from the list. Python does not recognize that the value is in list because it is a different object (successive calls of the fields property)

Unfortunatelly i have no time to fix this myself at the moment and make a pull request. Maybe i can do it another time. I am adding it as an issue anyway in case i forget about it.

allynt added a commit to allynt/django-rest-framework-gis that referenced this issue Aug 12, 2019
auvipy pushed a commit that referenced this issue Oct 4, 2019
* Update the way that `to_representation` removes already processed (#195)

fields, as per #194

* Upgrade GDAL to v2.x

* Fix test suite for Django v3.0
@auvipy auvipy closed this as completed Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants