Skip to content

Commit

Permalink
More precise naboj validator
Browse files Browse the repository at this point in the history
  • Loading branch information
sesquideus committed Jan 8, 2024
1 parent 156893a commit 97e1d55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/naboj/builder/contexts/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class NabojValidator(FileSystemValidator):
'intro.jtt': FileOrLink,
'instructions-inner.jtt': FileOrLink,
'evaluators.jtt': FileOrLink,
Optional('instructions-online-inner.md'): FileOrLink,
Optional('pictures'): {
Optional(Regex(r'.*\.png')): FileOrLink,
}
}
},
'venues': {
Expand Down Expand Up @@ -75,6 +79,7 @@ def _check_presence(self, filename, *, optional: bool = False):
}

lp = len([x for x, y in is_present.items() if y])

# If there are all files present, we're good, and if this is an optional file, then also if none are present
ok = (lp == len(translations)) or (optional and lp == 0)
if self.debug or not ok:
Expand Down

0 comments on commit 97e1d55

Please sign in to comment.