From 33f41df7850cf6d8ef9a1f9c87361671a82e25e6 Mon Sep 17 00:00:00 2001 From: Thomas Schaper Date: Mon, 13 Nov 2017 17:59:03 +0100 Subject: [PATCH] Make sure `children_loaded` is checked everywhere it is needed --- cgfs.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cgfs.py b/cgfs.py index be504b2b..fa591931 100755 --- a/cgfs.py +++ b/cgfs.py @@ -1258,6 +1258,7 @@ def get_submission(self, path): try: submission.tld except AttributeError: + assert submission.children_loaded self.load_submission_files(submission) return submission @@ -1271,10 +1272,7 @@ def get_file(self, path, start=None, expect_type=None): continue try: - if not any( - not isinstance(f, SpecialFile) - for f in file.children.values() - ): + if not file.children_loaded: if file.type == DirTypes.ASSIGNMENT: self.load_submissions(file) elif file.type == DirTypes.SUBMISSION: