Permalink
Browse files

Add a default value for widget_id

The widget_id when rendering a like widget defaulted to None, which
broke the widget when no id was supplied. This creates a default id for
widgets, which should be unique for that model instance.

Conflicts:

	phileo/templatetags/phileo_tags.py
  • Loading branch information...
1 parent 45b5c41 commit 012eab310884510dd198ee73b7c41106aa87d3fc Tim Heap committed Nov 28, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 phileo/templatetags/phileo_tags.py
@@ -83,6 +83,9 @@ def likes_widget(user, obj, widget_id=None, like_type="like", toggle_class="phil
receiver_object_id = obj.pk
).exists()
+ if widget_id == None:
+ widget_id = "phileo_%s_%s_%s" % (like_type, ct.pk, obj.pk)
+
like_count_id = "%s_count" % widget_id
like_url = reverse("phileo_like_toggle", kwargs={

0 comments on commit 012eab3

Please sign in to comment.