Repository: openwisp/openwisp-network-topology (language: python)

Issue:
[bug] Changing the status of a link from admin web interface does not work
Changing the status of a link from admin web interface does not work, eg:

- open a link change page
- change the status
- hit save and continue

Expected result: status changes.
Actual result: status does not change.
[bug] Changing the status of a link from admin web interface does not work
Changing the status of a link from admin web interface does not work, eg:

- open a link change page
- change the status
- hit save and continue

Expected result: status changes.
Actual result: status does not change.


Discussion / hints:

Fix patch:
diff --git a/openwisp_network_topology/integrations/device/overrides.py b/openwisp_network_topology/integrations/device/overrides.py
index 341dd4fe..b5f56038 100644
--- a/openwisp_network_topology/integrations/device/overrides.py
+++ b/openwisp_network_topology/integrations/device/overrides.py
@@ -60,6 +60,8 @@ def node_get_queryset(cls, qs):
             'organization__is_active',
             'label',
             'addresses',
+            'properties',
+            'user_properties',
             'devicenode__device__id',
             'devicenode__device__name',
             'devicenode__device__name',
@@ -84,6 +86,8 @@ def link_get_queryset(cls, qs):
             'organization__name',
             'organization__is_active',
             'status',
+            'properties',
+            'user_properties',
             'cost',
             'cost_text',
             'source__addresses',


Test patch:
diff --git a/openwisp_network_topology/integrations/device/tests.py b/openwisp_network_topology/integrations/device/tests.py
index bf4094ba..c72d94f4 100644
--- a/openwisp_network_topology/integrations/device/tests.py
+++ b/openwisp_network_topology/integrations/device/tests.py
@@ -489,3 +489,25 @@ def test_link_node_different_topology(self):
             link.full_clean()
         self.assertIn('source', context.exception.error_dict)
         self.assertIn('target', context.exception.error_dict)
+
+    def test_link_update_status(self):
+        t = Topology.objects.first()
+        n1 = self._create_node(label='node1org1', topology=t)
+        n2 = self._create_node(label='node2org1', topology=t)
+        link = self._create_link(topology=t, source=n1, target=n2)
+        path = reverse('{0}_link_change'.format(self.prefix), args=[link.pk])
+        response = self.client.post(
+            path,
+            data={
+                'topology': str(t.pk),
+                'organization': str(t.organization_id),
+                'source': str(n1.id),
+                'target': str(n2.id),
+                'cost': '1.0',
+                'status': 'down',
+            },
+            follow=True,
+        )
+        self.assertEqual(response.status_code, 200)
+        link.refresh_from_db()
+        self.assertEqual(link.status, 'down')