def late_versioning_catch(document, resource):
 resource_def = app.config['DOMAIN'][resource]
 version = app.config['VERSION']
 if (resource_def['versioning'] is True):
  if (version not in document):
   resolve_document_version(document, resource, 'POST')
   insert_versioning_documents(resource, document)

def late_versioning_catch ( document , resource ) : resource_def = app . config [ 'DOMAIN' ] [ resource ] version = app . config [ 'VERSION' ] if ( resource_def [ 'versioning' ] is True ) : if ( version not in document ) : resolve_document_version ( document , resource , 'POST' ) insert_versioning_documents ( resource , document )
insert versioning copy of document for the previous version of a document if it is missing .