]> git.ipfire.org Git - thirdparty/patchwork.git/commit
compat: Add non-None queryset attribute
authorStephen Finucane <stephen@that.guru>
Tue, 4 Apr 2017 21:38:18 +0000 (22:38 +0100)
committerStephen Finucane <stephen@that.guru>
Fri, 28 Apr 2017 21:20:03 +0000 (22:20 +0100)
commit433a35bcc7cabbc6198d81d2a7e09621866dc51f
tree0606551c1a7125993f745b10a17f454a5ec46c4b
parente8b60ac12a2fc339109f851da1cb543a220b7300
compat: Add non-None queryset attribute

Older versions of Django REST Framework's 'RelatedField' did not check
for the presence 'get_queryset' before checking for a 'queryset'
attribute. This was fixed in 3.4.0 [1] and backported to the 3.3 series
in 3.3.3 [2]. However, the fix was not backported to the last release of
3.2 series [3], which is the last release to support Django 1.6. As
such, we must set a 'queryset' attribute, even if it's set to a garbage
value.

[1] ../blob/3.4.0/rest_framework/relations.py#L78-L82
[2] ../blob/3.3.3/rest_framework/relations.py#L78-L82
[3] ../blob/3.2.5/rest_framework/relations.py#L64-L67

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes-bug: #94
patchwork/api/patch.py