Skip to content

Commit c33f80c

Browse files
committed
add context to target_button Partial
1 parent 04237f6 commit c33f80c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tom_targets/templatetags/targets_extras.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ def target_feature(target):
7070
return {'target': target}
7171

7272

73-
@register.inclusion_tag('tom_targets/partials/target_buttons.html')
74-
def target_buttons(target):
73+
@register.inclusion_tag('tom_targets/partials/target_buttons.html', takes_context=True)
74+
def target_buttons(context, target):
7575
"""
7676
Displays the Update and Delete and Sharing buttons for a target.
7777
"""
7878
sharing = getattr(settings, "DATA_SHARING", None)
79-
return {'target': target,
80-
'sharing': sharing}
79+
context['target'] = target
80+
context['sharing'] = sharing
81+
return context
8182

8283

8384
@register.inclusion_tag('tom_targets/partials/target_data.html')

0 commit comments

Comments
 (0)