Skip to content

Commit

Permalink
Fixes #12961: Set correct return_url for object contacts tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jun 26, 2023
1 parent d131d9b commit 74d9fe1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions netbox/templates/tenancy/object_contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
{% load helpers %}

{% block extra_controls %}
{% if perms.tenancy.add_contactassignment %}
<a href="{% url 'tenancy:contactassignment_add' %}?content_type={{ object|content_type_id }}&object_id={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
{% if perms.tenancy.add_contactassignment %}
{% with viewname=object|viewname:"contacts" %}
<a href="{% url 'tenancy:contactassignment_add' %}?content_type={{ object|content_type_id }}&object_id={{ object.pk }}&return_url={% url viewname pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a contact
</a>
</a>
{% endwith %}
{% endif %}
{% endblock %}

Expand Down

0 comments on commit 74d9fe1

Please sign in to comment.