Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions netbox_lifecycle/template_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def _render_contract_card(self, location=None):
if self.get_contract_card_position() != location:
return ''

context = self.get_context(self.context)

title = _('Contracts')
action = [
actions.AddObject(
Expand Down Expand Up @@ -159,7 +161,6 @@ def _render_contract_card(self, location=None):
filter = {
self.field_name: lambda ctx: ctx['object'].pk,
}
context = self.get_context(self.context)
panel = TabbedTablePanel(
title=title,
tabs={
Expand Down Expand Up @@ -209,6 +210,8 @@ def _render_license_card(self, location=None, exclude=None, include=None):
if self.get_license_card_position() != location:
return ''

context = self.get_context(self.context)

action = [
actions.AddObject(
'netbox_lifecycle.LicenseAssignment',
Expand All @@ -218,7 +221,6 @@ def _render_license_card(self, location=None, exclude=None, include=None):
),
]

context = self.get_context(self.context)
panel = panels.ObjectsTablePanel(
title=_('Licenses'),
model='netbox_lifecycle.licenseassignment',
Expand Down
Loading