mirror of
https://github.com/correl/mtgsqlive.git
synced 2024-11-24 19:19:53 +00:00
translations may be non-existent
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
This commit is contained in:
parent
9f575175bd
commit
0d08bb8b92
1 changed files with 2 additions and 3 deletions
|
@ -299,7 +299,7 @@ def parse_and_import_cards(
|
|||
token_attr = handle_token_row_insertion(token, set_code)
|
||||
sql_dict_insert(token_attr, "tokens", sql_connection)
|
||||
|
||||
for language, translation in set_data["translations"].items():
|
||||
for language, translation in set_data.get("translations", {}).items():
|
||||
LOGGER.debug("Inserting set_translation row for {}".format(language))
|
||||
set_translation_attr = handle_set_translation_row_insertion(
|
||||
language, translation, set_code
|
||||
|
@ -326,7 +326,7 @@ def parse_and_import_cards(
|
|||
token_attr = handle_token_row_insertion(token, set_code)
|
||||
sql_dict_insert(token_attr, "tokens", sql_connection)
|
||||
|
||||
for language, translation in set_data["translations"].items():
|
||||
for language, translation in set_data.get("translations", {}).items():
|
||||
LOGGER.debug("Inserting set_translation row for {}".format(language))
|
||||
set_translation_attr = handle_set_translation_row_insertion(
|
||||
language, translation, set_code
|
||||
|
@ -336,7 +336,6 @@ def parse_and_import_cards(
|
|||
)
|
||||
sql_connection.commit()
|
||||
|
||||
|
||||
def sql_insert_all_card_fields(
|
||||
card_attributes: Dict[str, Any], sql_connection: sqlite3.Connection
|
||||
) -> None:
|
||||
|
|
Loading…
Reference in a new issue