From 846a41d2e2d4c8a2a67138311befb6b1ed7f26d6 Mon Sep 17 00:00:00 2001 From: tritoch Date: Fri, 7 Jul 2017 16:27:22 -0500 Subject: [PATCH] Error on type not in valid type list (#108) --- spoilers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spoilers.py b/spoilers.py index 9dc7710d..6fb03597 100644 --- a/spoilers.py +++ b/spoilers.py @@ -219,6 +219,11 @@ def error_check(mtgjson, card_corrections={}): errors.append({"name": card['name'], "key": "number", "value": ""}) if not 'types' in card: errors.append({"name": card['name'], "key": "types", "value": ""}) + else: + for type in card['types']: + if type not in ['Creature', 'Artifact', 'Conspiracy', 'Enchantment', 'Instant', 'Land', 'Phenomenon', 'Plane', 'Planeswalker', 'Scheme', + 'Sorcery', 'Tribal', 'Vanguard']: + errors.append({"name": card['name'], "key": "types", "value":card['types']}) # we're going to loop through again and make sure split cards get paired for card in mtgjson['cards']: