Merge pull request #253 from eReuse/changes/#3327-drop-public-link-csv
drop download public links
This commit is contained in:
commit
1a04b44dbe
|
@ -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(
|
||||
|
|
|
@ -201,12 +201,6 @@
|
|||
Metrics Spreadsheet
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:export_file('links')" class="dropdown-item">
|
||||
<i class="bi bi-link-45deg"></i>
|
||||
Public Links
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:export_file('certificates')" class="dropdown-item">
|
||||
<i class="bi bi-eraser-fill"></i>
|
||||
|
|
|
@ -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):
|
||||
|
|
Reference in a new issue