We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd5b73c commit bd5da62Copy full SHA for bd5da62
1 file changed
08-Check-ODAP-Tables.py
@@ -211,4 +211,24 @@
211
log.error("Found at least one bad author email; ending audit here.")
212
sys.exit(7)
213
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
234
log.info("All checks completed successfully.")
0 commit comments