@permission_required('wiki.delete_document')
def delete_document(request, document):
 try:
  DocumentDeletionLog.objects.create(locale=document.locale, slug=document.slug, user=request.user, reason='Spam')
  document.delete()
 except Exception:
  return False
 return True

@ permission_required ( 'wiki.delete_document' ) def delete_document ( request , document ) : try : DocumentDeletionLog . objects . create ( locale = document . locale , slug = document . slug , user = request . user , reason = 'Spam' ) document . delete ( ) except Exception : return False return True
delete a document .