From 72c19501fa230a34599664d7db7586a0ea8091b0 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 24 Jun 2022 12:39:46 +0200 Subject: [PATCH] fixing path --- ereuse_devicehub/workbench/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ereuse_devicehub/workbench/views.py b/ereuse_devicehub/workbench/views.py index 85bb22f6..c23e783f 100644 --- a/ereuse_devicehub/workbench/views.py +++ b/ereuse_devicehub/workbench/views.py @@ -1,5 +1,6 @@ import os import time +from pathlib import Path import flask from flask import Blueprint @@ -37,10 +38,9 @@ class SettingsView(GenericMixin): return flask.render_template(self.template_name, **self.context) def get_iso(self): + path = Path(__file__).parent.parent files = [ - f - for f in os.listdir('ereuse_devicehub/static/iso/') - if f[-3:].lower() == 'iso' + f for f in os.listdir(f'{path}/static/iso/') if f[-3:].lower() == 'iso' ] self.context['iso'] = ''