Răsfoiți Sursa

Merge pull request #3764 from kobayashi/3679

fix 3757
Jeremy Stretch 6 ani în urmă
părinte
comite
1acdf58a4b
2 a modificat fișierele cu 6 adăugiri și 1 ștergeri
  1. 1 0
      docs/release-notes/version-2.6.md
  2. 5 1
      netbox/ipam/tables.py

+ 1 - 0
docs/release-notes/version-2.6.md

@@ -11,6 +11,7 @@
 * [#2170](https://github.com/netbox-community/netbox/issues/2170) - Prevent the deletion of a virtual chassis when a cross-member LAG is present
 * [#2358](https://github.com/netbox-community/netbox/issues/2358) - Respect custom field default values when creating objects via the REST API
 * [#3749](https://github.com/netbox-community/netbox/issues/3749) - Fix exception on password change page for local users
+* [#3757](https://github.com/netbox-community/netbox/issues/3757) - Fix unable to assign IP to interface
 
 # v2.6.8 (2019-12-10)
 

+ 5 - 1
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 = """