diff --git a/__pycache__/app.cpython-312.pyc b/__pycache__/app.cpython-312.pyc index 41f7a9b..ac4abd6 100644 Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ diff --git a/app.py b/app.py index e84a4e4..f73752d 100644 --- a/app.py +++ b/app.py @@ -481,8 +481,11 @@ def upload_personalization_pictures(): def clean_unused_files(): # Get all file names from the database content_files = {content.file_name for content in Content.query.all()} - logo_file = 'logo.png' - login_picture_file = 'login_picture.png' + logo_file = 'resurse/logo.png' + login_picture_file = 'resurse/login_picture.png' + + # Debugging: Print the content files from the database + print("Content files from database:", content_files) # Get all files in the upload folder all_files = set(os.listdir(app.config['UPLOAD_FOLDER'])) @@ -491,15 +494,22 @@ def clean_unused_files(): used_files = content_files | {logo_file, login_picture_file} unused_files = all_files - used_files + # Debugging: Print the lists of files + print("All files:", all_files) + print("Used files:", used_files) + print("Unused files:", unused_files) + # Delete unused files for file_name in unused_files: file_path = os.path.join(app.config['UPLOAD_FOLDER'], file_name) if os.path.isfile(file_path): + print(f"Deleting file: {file_path}") # Debugging: Print the file being deleted os.remove(file_path) flash('Unused files have been cleaned.', 'success') return redirect(url_for('admin')) + @app.context_processor def inject_theme(): if current_user.is_authenticated: diff --git a/instance/dashboard.db b/instance/dashboard.db index bc16192..3daa379 100644 Binary files a/instance/dashboard.db and b/instance/dashboard.db differ diff --git a/static/uploads/Copie_a_free-4-box-diagram-static-16x9__page_1.png b/static/uploads/Copie_a_free-4-box-diagram-static-16x9__page_1.png deleted file mode 100644 index 75f88c4..0000000 Binary files a/static/uploads/Copie_a_free-4-box-diagram-static-16x9__page_1.png and /dev/null differ diff --git a/static/uploads/Ibex_450.jpg b/static/uploads/Ibex_450.jpg new file mode 100644 index 0000000..5f3b4b8 Binary files /dev/null and b/static/uploads/Ibex_450.jpg differ diff --git a/templates/dashboard.html b/templates/dashboard.html index b95ac26..e845d72 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -24,7 +24,7 @@
+
{% endif %}
+
{% endif %}
+
{% endif %}