Merge pull request #253 from eReuse/changes/#3327-drop-public-link-csv

drop download public links
This commit is contained in:
cayop 2022-05-05 18:56:08 +02:00 committed by GitHub
commit 1a04b44dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 32 deletions

View File

@ -421,7 +421,6 @@ class ExportsView(View):
'metrics': self.metrics, 'metrics': self.metrics,
'devices': self.devices_list, 'devices': self.devices_list,
'certificates': self.erasure, 'certificates': self.erasure,
'links': self.public_links,
} }
if export_id not in export_ids: if export_id not in export_ids:
@ -497,19 +496,6 @@ class ExportsView(View):
return self.response_csv(data, "actions_export.csv") 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): def erasure(self):
template = self.build_erasure_certificate() template = self.build_erasure_certificate()
res = flask_weasyprint.render_pdf( res = flask_weasyprint.render_pdf(

View File

@ -201,12 +201,6 @@
Metrics Spreadsheet Metrics Spreadsheet
</a> </a>
</li> </li>
<li>
<a href="javascript:export_file('links')" class="dropdown-item">
<i class="bi bi-link-45deg"></i>
Public Links
</a>
</li>
<li> <li>
<a href="javascript:export_file('certificates')" class="dropdown-item"> <a href="javascript:export_file('certificates')" class="dropdown-item">
<i class="bi bi-eraser-fill"></i> <i class="bi bi-eraser-fill"></i>

View File

@ -243,18 +243,6 @@ def test_export_metrics(user3: UserClientFlask):
assert body == '' 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.mvp
@pytest.mark.usefixtures(conftest.app_context.__name__) @pytest.mark.usefixtures(conftest.app_context.__name__)
def test_export_certificates(user3: UserClientFlask): def test_export_certificates(user3: UserClientFlask):