Merge lp://staging/~danilo/maas/django-upgrade-immutable-querydict into lp://staging/~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Данило Шеган |
Approved revision: | no longer in the source branch. |
Merged at revision: | 6101 |
Proposed branch: | lp://staging/~danilo/maas/django-upgrade-immutable-querydict |
Merge into: | lp://staging/~maas-committers/maas/trunk |
Prerequisite: | lp://staging/~danilo/maas/django-upgrade-legacy-migrations |
Diff against target: |
259 lines (+60/-38) 9 files modified
src/maasserver/api/boot_resources.py (+1/-1) src/maasserver/api/commissioning_scripts.py (+8/-6) src/maasserver/api/dnsresourcerecords.py (+6/-5) src/maasserver/api/dnsresources.py (+2/-2) src/maasserver/api/scripts.py (+10/-8) src/maasserver/forms/__init__.py (+9/-0) src/maasserver/forms/ephemeral.py (+1/-1) src/maasserver/forms/iprange.py (+2/-0) src/maasserver/forms/script.py (+21/-15) |
To merge this branch: | bzr merge lp://staging/~danilo/maas/django-upgrade-immutable-querydict |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Blake Rouse (community) | Approve | ||
Review via email: mp+325995@code.staging.launchpad.net |
Commit message
Replace all in-place modifying of POST data which is immutable in more recent Django versions.
Description of the change
request.data contains QueryDict objects which have become immutable by default.
In most cases, it was sufficient to create a copy of the data on the API side before passing it on to the form processing machinery (or instantiating the form with it).
But for some reason that did not work that well in LicenseKeyForm: I had to modify the internal "_mutable" attribute to be able to edit the data in-place. The problem is how the data is processed there: it wants to allow API to pass in a combined osystem/
This gets us down to 66 test failures with django 1.11 from ppa:danilo/
Looks good overall. Just one comment on the section that should be of no surprise. ;-)