From d802443c59298c10d51d99a3cdeb32038a38b75a Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Tue, 12 Sep 2023 21:07:10 +0200 Subject: [PATCH] TEMP FIX to make sure we don't select any files from the database that either are empty ('') or don't have any snapshot saved --- pilot/helpers/Project.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pilot/helpers/Project.py b/pilot/helpers/Project.py index 730910b..047c075 100644 --- a/pilot/helpers/Project.py +++ b/pilot/helpers/Project.py @@ -147,7 +147,17 @@ class Project: list: A list of coded files. """ files = File.select().where(File.app_id == self.args['app_id']) + + # TODO temoprary fix to eliminate files that are not in the project + files = [file for file in files if len(FileSnapshot.select().where(FileSnapshot.file_id == file.id)) > 0] + # TODO END + files = self.get_files([file.path + '/' + file.name for file in files]) + + # TODO temoprary fix to eliminate files that are not in the project + files = [file for file in files if file['content'] != ''] + # TODO END + return files def get_files(self, files):