File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 211211 log .error ("Found at least one bad author email; ending audit here." )
212212 sys .exit (7 )
213213
214+ ##
215+ ## Check for stories without chapters
216+ ##
217+
218+ log .debug ("Checking for stories without any chapters." )
219+ found_error = False
220+
221+ empty_stories = sql .execute_dict (
222+ "SELECT s.id as sid FROM stories s LEFT JOIN chapters c ON c.story_id = s.id WHERE c.story_id IS NULL"
223+ )
224+
225+ if empty_stories :
226+ found_error = True
227+ for story in empty_stories :
228+ log .error (f"Found story with no chapters: { story ['sid' ]} " )
229+
230+ if found_error :
231+ log .error ("Found at least one story with no chapters; ending audit here." )
232+ sys .exit (8 )
233+
214234 log .info ("All checks completed successfully." )
You can’t perform that action at this time.
0 commit comments