

def get_draft(self, node):
    '\n        Return most recently edited version of wiki, whether that is the\n        last saved version or the most recent sharejs draft.\n        '
    db = wiki_utils.share_db()
    sharejs_uuid = wiki_utils.get_sharejs_uuid(node, self.page_name)
    doc_item = db['docs'].find_one({
        '_id': sharejs_uuid,
    })
    if doc_item:
        sharejs_version = doc_item['_v']
        sharejs_timestamp = doc_item['_m']['mtime']
        sharejs_timestamp /= 1000
        sharejs_date = datetime.datetime.utcfromtimestamp(sharejs_timestamp)
        if ((sharejs_version > 1) and (sharejs_date > self.date)):
            return doc_item['_data']
    return node.content

dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/wiki/model.py NodeWikiPage.get_draft/VarMisuse@119/234 `self`->`node`