Merge lp:~rvb/maas/getlist-1.3-compat into lp:maas/1.2

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 1305
Proposed branch: lp:~rvb/maas/getlist-1.3-compat
Merge into: lp:maas/1.2
Diff against target: 24 lines (+1/-2)
2 files modified
src/maasserver/api.py (+1/-1)
src/maasserver/tests/test_preseed.py (+0/-1)
To merge this branch: bzr merge lp:~rvb/maas/getlist-1.3-compat
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+134891@code.launchpad.net

Commit message

Fix call to request.data.getlist to make it Django 1.3-compatible.

Description of the change

This fixes a compatibility with Django 1.3 (found while running the test suite of of the 1.2 branch on a precise box):
The 1.3 version of the method 'getlist' does not support the 'default' parameter.

Turns out we already implemented a utility method to work around that limitation ('get_optional_list').

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/api.py'
2--- src/maasserver/api.py 2012-11-08 09:54:37 +0000
3+++ src/maasserver/api.py 2012-11-19 12:38:56 +0000
4@@ -362,7 +362,7 @@
5 """
6 getlist = getattr(data, 'getlist', None)
7 if getlist is not None:
8- return getlist(key, default)
9+ return get_optional_list(data, key, default)
10 return data.get(key, default)
11
12
13
14=== modified file 'src/maasserver/tests/test_preseed.py'
15--- src/maasserver/tests/test_preseed.py 2012-11-15 12:05:06 +0000
16+++ src/maasserver/tests/test_preseed.py 2012-11-19 12:38:56 +0000
17@@ -21,7 +21,6 @@
18 NODE_STATUS,
19 PRESEED_TYPE,
20 )
21-from maasserver.models import BootImage
22 from maasserver.preseed import (
23 compose_enlistment_preseed_url,
24 compose_preseed_url,

Subscribers

People subscribed via source and target branches

to status/vote changes: