From 3d712e2f1111fd67c5952057b72f2e1ef05e5fea Mon Sep 17 00:00:00 2001 From: mstrecker Date: Sat, 29 Apr 2017 22:35:02 +0200 Subject: [PATCH] Fix Django 1.11 compatibility issue: https://docs.djangoproject.com/en/1.11/releases/1.11/#django-template-backends-django-template-render-prohibits-non-dict-context --- stream_django/templatetags/activity_tags.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stream_django/templatetags/activity_tags.py b/stream_django/templatetags/activity_tags.py index 2f7f107..c79dac6 100644 --- a/stream_django/templatetags/activity_tags.py +++ b/stream_django/templatetags/activity_tags.py @@ -43,8 +43,10 @@ def render_activity(context, activity, template_prefix='', missing_data_policy=L tmpl = loader.get_template(template_name) context['activity'] = activity - if django.get_version() < 1.11: + if float(django.get_version()) < 1.11: context = Context(context) + elif isinstance(context, Context): + context = context.flatten() return tmpl.render(context)