From 3ca729244835daa1815118443e577229ad6520b9 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 5 May 2022 18:36:52 +0200 Subject: [PATCH] drop download public links --- ereuse_devicehub/inventory/views.py | 14 -------------- .../templates/inventory/device_list.html | 6 ------ tests/test_render_2_0.py | 12 ------------ 3 files changed, 32 deletions(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 503632e6..2df8fd69 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -421,7 +421,6 @@ class ExportsView(View): 'metrics': self.metrics, 'devices': self.devices_list, 'certificates': self.erasure, - 'links': self.public_links, } if export_id not in export_ids: @@ -497,19 +496,6 @@ class ExportsView(View): return self.response_csv(data, "actions_export.csv") - def public_links(self): - # get a csv with the publink links of this devices - data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') - cw.writerow(['links']) - host_url = request.host_url - for dev in self.find_devices(): - code = dev.devicehub_id - link = [f"{host_url}devices/{code}"] - cw.writerow(link) - - return self.response_csv(data, "links.csv") - def erasure(self): template = self.build_erasure_certificate() res = flask_weasyprint.render_pdf( diff --git a/ereuse_devicehub/templates/inventory/device_list.html b/ereuse_devicehub/templates/inventory/device_list.html index 0f5dcedb..b95334f8 100644 --- a/ereuse_devicehub/templates/inventory/device_list.html +++ b/ereuse_devicehub/templates/inventory/device_list.html @@ -201,12 +201,6 @@ Metrics Spreadsheet -
  • - - - Public Links - -
  • diff --git a/tests/test_render_2_0.py b/tests/test_render_2_0.py index 8e9f89af..ac41ef09 100644 --- a/tests/test_render_2_0.py +++ b/tests/test_render_2_0.py @@ -243,18 +243,6 @@ def test_export_metrics(user3: UserClientFlask): assert body == '' -@pytest.mark.mvp -@pytest.mark.usefixtures(conftest.app_context.__name__) -def test_export_links(user3: UserClientFlask): - snap = create_device(user3, 'real-eee-1001pxd.snapshot.12.json') - uri = "/inventory/export/links/?ids={id}".format(id=snap.device.devicehub_id) - - body, status = user3.get(uri) - assert status == '200 OK' - body = body.split("\n") - assert ['links', 'http://localhost/devices/O48N2', ''] == body - - @pytest.mark.mvp @pytest.mark.usefixtures(conftest.app_context.__name__) def test_export_certificates(user3: UserClientFlask):