# HG changeset patch # User neko259 # Date 2018-04-06 07:39:18 # Node ID c4ac6a572c5e2012910fbd31b33915d6537114a0 # Parent b923ca76e1b0391528fe5b4a69b862861ae84abc If there is no post update time, use pub time diff --git a/boards/models/post/sync.py b/boards/models/post/sync.py --- a/boards/models/post/sync.py +++ b/boards/models/post/sync.py @@ -196,7 +196,14 @@ class SyncManager: global_id, exists = GlobalId.from_xml_element(tag_id) signatures = SyncManager._verify_model(global_id, content_str, tag_model) - update_time = tag_content.find(TAG_UPDATE_TIME).text + pub_time = tag_content.find(TAG_PUB_TIME).text + + tag_update_time = tag_content.find(TAG_UPDATE_TIME) + if tag_update_time: + update_time = tag_content.find(TAG_UPDATE_TIME).text + else: + update_time = pub_time + is_old = exists and global_id.post.last_edit_time < parse_datetime(update_time) if exists and not is_old: logger.debug('Post {} exists and is up to date.'.format(global_id)) @@ -215,7 +222,6 @@ class SyncManager: else: tripcode = '' - pub_time = tag_content.find(TAG_PUB_TIME).text thread = tag_content.find(TAG_THREAD) tags = [] if thread: