Merge lp:~danilo/maas/django-upgrade-immutable-querydict into lp:maas/trunk
Status: | Merged |
---|---|
Approved by: | Данило Шеган on 2017-06-21 |
Approved revision: | 6120 |
Merged at revision: | 6101 |
Proposed branch: | lp:~danilo/maas/django-upgrade-immutable-querydict |
Merge into: | lp:maas/trunk |
Prerequisite: | lp:~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:~danilo/maas/django-upgrade-immutable-querydict |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Blake Rouse (community) | 2017-06-20 | Approve on 2017-06-20 | |
Review via email:
|
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/
Данило Шеган (danilo) wrote : | # |
Addressed the comment: after looking some more, I think I can fix this in a nicer way, but I'd rather do that as a separate branch since it requires test changes (which means more risk).
Blake Rouse (blake-rouse) wrote : | # |
Sounds good. Yeah that is much better.
The clean_osystem and clean_distro_series should not rely on each others filed values. When you need to validate two field together that should take place in the clean method.
Данило Шеган (danilo) wrote : | # |
This needs to wait for prereq before itcan land.
Follow-up branch up at https:/
Looks good overall. Just one comment on the section that should be of no surprise. ;-)