@xframe_options_sameorigin
def _edit_document_collision(request, orig_rev, curr_rev, is_async_submit, is_raw, rev_form, doc_form, section_id, rev, doc):
 content = kuma.wiki.content.parse(request.POST['content']).injectSectionIDs().serialize()
 if doc.is_template:
  curr_content = curr_rev.content
 else:
  parsed_content = kuma.wiki.content.parse(curr_rev.content)
  parsed_content.injectSectionIDs()
  if section_id:
   parsed_content.extractSection(section_id)
  curr_content = parsed_content.serialize()
 if is_raw:
  response = HttpResponse('CONFLICT')
  response.status_code = 409
  return response
 context = {'collision': True, 'revision_form': rev_form, 'document_form': doc_form, 'content': content, 'current_content': curr_content, 'section_id': section_id, 'original_revision': orig_rev, 'current_revision': curr_rev, 'revision': rev, 'document': doc}
 return render(request, 'wiki/edit.html', context)

@ xframe_options_sameorigin def _edit_document_collision ( request , orig_rev , curr_rev , is_async_submit , is_raw , rev_form , doc_form , section_id , rev , doc ) : content = kuma . wiki . content . parse ( request . POST [ 'content' ] ) . injectSectionIDs ( ) . serialize ( ) if doc . is_template : curr_content = curr_rev . content else : parsed_content = kuma . wiki . content . parse ( curr_rev . content ) parsed_content . injectSectionIDs ( ) if section_id : parsed_content . extractSection ( section_id ) curr_content = parsed_content . serialize ( ) if is_raw : response = HttpResponse ( 'CONFLICT' ) response . status_code = 409 return response context = { 'collision' : True , 'revision_form' : rev_form , 'document_form' : doc_form , 'content' : content , 'current_content' : curr_content , 'section_id' : section_id , 'original_revision' : orig_rev , 'current_revision' : curr_rev , 'revision' : rev , 'document' : doc } return render ( request , 'wiki/edit.html' , context )
handle when a mid-air collision is detected upon submission .