Skip to content

Commit a54e9bd

Browse files
authored
Merge pull request #1549 from TOMToolkit/1548-no-context-supplied-to-target-buttons
add context to target_button Partial
2 parents 04237f6 + c33f80c commit a54e9bd

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)