Browse Source

Merge pull request #363 from apkallum/apkallum-django

fix: timestamp comparison in from_json function
Nick Sweeting 5 years ago
parent
commit
15c1cb39e9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      archivebox/index/schema.py

+ 4 - 1
archivebox/index/schema.py

@@ -190,7 +190,10 @@ class Link:
             for key, val in json_info.items()
             if key in cls.field_names()
         }
-        info['updated'] = parse_date(info.get('updated'))
+        try:
+            info['updated'] = int(parse_date(info.get('updated'))) # Cast to int which comes with rounding down
+        except (ValueError, TypeError):
+            info['updated'] = None
         info['sources'] = info.get('sources') or []
 
         json_history = info.get('history') or {}