@block_user_agents
@login_required
@permission_required('wiki.purge_document')
@check_readonly
@process_document_path
def purge_document(request, document_slug, document_locale):
 document = get_object_or_404(Document.deleted_objects.all(), slug=document_slug, locale=document_locale)
 if ((request.method == 'POST') and ('confirm' in request.POST)):
  document.purge()
  return redirect(reverse('wiki.document', args=(document_slug,), locale=document_locale))
 else:
  return render(request, 'wiki/confirm_purge.html', {'document': document})

@ block_user_agents @ login_required @ permission_required ( 'wiki.purge_document' ) @ check_readonly @ process_document_path def purge_document ( request , document_slug , document_locale ) : document = get_object_or_404 ( Document . deleted_objects . all ( ) , slug = document_slug , locale = document_locale ) if ( ( request . method == 'POST' ) and ( 'confirm' in request . POST ) ) : document . purge ( ) return redirect ( reverse ( 'wiki.document' , args = ( document_slug , ) , locale = document_locale ) ) else : return render ( request , 'wiki/confirm_purge.html' , { 'document' : document } )
permanently purge a deleted document .