]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/readers.py
Resolves OSQA-735, return the object if it doesn't return dict context
[osqa.git] / forum / views / readers.py
index 8dad7801a1720afc8b0a7c551a5fc6676f5a650b..7404b924c6cd6359ce1b490c4b78a63fbb3552f1 100644 (file)
@@ -119,12 +119,18 @@ def tag(request, tag):
     }
 
     # The context returned by the question_list function, contains info about the questions
     }
 
     # The context returned by the question_list function, contains info about the questions
-    question_context = dict(question_list(request,
+    question_context = question_list(request,
                          questions,
                          mark_safe(_(u'questions tagged <span class="tag">%(tag)s</span>') % {'tag': tag}),
                          None,
                          mark_safe(_(u'Questions Tagged With %(tag)s') % {'tag': tag}),
                          questions,
                          mark_safe(_(u'questions tagged <span class="tag">%(tag)s</span>') % {'tag': tag}),
                          None,
                          mark_safe(_(u'Questions Tagged With %(tag)s') % {'tag': tag}),
-                         False))
+                         False)
+
+    # If the return data type is not a dict just return it
+    if not isinstance(question_context, dict):
+        return question_context
+
+    question_context = dict(question_context)
 
     # Create the combined context
     context = dict(question_context.items() + tag_context.items())
 
     # Create the combined context
     context = dict(question_context.items() + tag_context.items())