1
0
Fork 0

fix if to elif bug in index snapshot sql writing

This commit is contained in:
Nick Sweeting 2020-06-25 17:48:27 -04:00
parent 43c471e4af
commit fae2fdaf2b

View file

@ -35,7 +35,7 @@ def write_sql_main_index(links: List[Link], out_dir: str=OUTPUT_DIR) -> None:
info = {k: v for k, v in all_urls.pop(snapshot.url)._asdict().items() if k in Snapshot.keys}
snapshot.delete()
Snapshot.objects.create(**info)
if snapshot.url in all_urls:
elif snapshot.url in all_urls:
info = {k: v for k, v in all_urls.pop(snapshot.url)._asdict().items() if k in Snapshot.keys}
snapshot.delete()
Snapshot.objects.create(**info)