MFH: r520173

net-mgmt/netbox: Fix assignment of IP addresses to interfaces

* Backport a patch from upstream's repository which fixes the assignment of
  existing IP addresses to interfaces.

  Without that patch the assignment of an IP address gives no error but the
  interface doesn't contain the assigned IP address at the end.

* Bump PORTREVISION for package change.

Approved by:	ports-secteam bugfix blanket
This commit is contained in:
Kai Knoblich 2019-12-15 12:33:06 +00:00
parent d521871a49
commit ddc515173f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2019Q4/; revision=520174
2 changed files with 21 additions and 0 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= netbox
DISTVERSIONPREFIX= v
DISTVERSION= 2.6.8
PORTREVISION= 1
CATEGORIES= net-mgmt
MAINTAINER= kai@FreeBSD.org

View File

@ -0,0 +1,20 @@
Fix unable to assign existing IP addresses to interfaces
Obtained from:
https://github.com/netbox-community/netbox/commit/1acdf58a4bb35d83a280464ac69aa961ff614df7
--- netbox/ipam/tables.py.orig 2019-12-15 11:43:12 UTC
+++ netbox/ipam/tables.py
@@ -85,7 +85,11 @@ IPADDRESS_LINK = """
"""
IPADDRESS_ASSIGN_LINK = """
-<a href="{% url 'ipam:ipaddress_edit' pk=record.pk %}?interface={{ record.interface.pk }}&return_url={{ request.path }}">{{ record }}</a>
+{% if request.GET %}
+ <a href="{% url 'ipam:ipaddress_edit' pk=record.pk %}?interface={{ request.GET.interface }}&return_url={{ request.GET.return_url }}">{{ record }}</a>
+{% else %}
+ <a href="{% url 'ipam:ipaddress_edit' pk=record.pk %}?interface={{ record.interface.pk }}&return_url={{ request.path }}">{{ record }}</a>
+{% endif %}
"""
IPADDRESS_PARENT = """