diff --git a/tools/atlas.schema.json b/tools/atlas.schema.json index e2d9aa04..cf4f764d 100644 --- a/tools/atlas.schema.json +++ b/tools/atlas.schema.json @@ -10,7 +10,8 @@ "type": "string" }, { - "type": "integer" + "type": "integer", + "minimum": 0 } ], "description": "The ID of the entry. Usually this is the post ID of the new entry submission." diff --git a/tools/redditcrawl.py b/tools/redditcrawl.py index 9f5a4103..f64f1cb7 100755 --- a/tools/redditcrawl.py +++ b/tools/redditcrawl.py @@ -103,13 +103,13 @@ def set_flair(submission, flair): if submission.link_flair_text == "Edit Entry": - assert submission_json["id"] != 0, "Edit invalid because ID is tampered, it must not be 0!" + assert submission_json["id"] > 0, "Edit invalid because ID is tampered, it must not be 0 or -1!" submission_json_dummy = {"id": submission_json["id"], "edit": submission.id} else: - assert submission_json["id"] == 0, "Edit invalid because ID is tampered, it must be 0!" + assert submission_json["id"] <= 0, "Addition invalid because ID is tampered, it must be 0 or -1!" submission_json_dummy = {"id": submission.id} diff --git a/web/_js/main/draw.js b/web/_js/main/draw.js index 5cc07c07..cd1c0763 100644 --- a/web/_js/main/draw.js +++ b/web/_js/main/draw.js @@ -260,7 +260,7 @@ function initDraw() { function generateExportObject() { const exportObject = { - id: entryId ?? 0, + id: entryId ?? -1, name: nameField.value, description: descriptionField.value, links: {},