From 0ce882dd7bace728d19a40c9b6cdfafefc11df70 Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Mon, 6 Jun 2016 15:26:48 +0200 Subject: [PATCH] Make the Django 1.6 support more explicit for PR #218 --- polymorphic/query_translate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/polymorphic/query_translate.py b/polymorphic/query_translate.py index 00447fb..67f8c6b 100644 --- a/polymorphic/query_translate.py +++ b/polymorphic/query_translate.py @@ -100,7 +100,10 @@ def translate_polymorphic_filter_definitions_in_args(queryset_model, args, using Returns: modified Q objects """ - q_objects = [q if django.VERSION < (1, 6) else q.clone() for q in args] + if django.VERSION >= (1, 6): + q_objects = [q.clone() for q in args] + else: + q_objects = args # NOTE: edits existing objects in place. return [translate_polymorphic_Q_object(queryset_model, q, using=using) for q in q_objects]