@login_required
def delete_question(request, question_id):
 question = get_object_or_404(Question, pk=question_id)
 if (not question.allows_delete(request.user)):
  raise PermissionDenied
 if (request.method == 'GET'):
  return render(request, 'questions/confirm_question_delete.html', {'question': question})
 product = question.product_slug
 log.warning(('User %s is deleting question with id=%s' % (request.user, question.id)))
 question.delete()
 statsd.incr('questions.delete')
 return HttpResponseRedirect(reverse('questions.list', args=[product]))

@ login_required def delete_question ( request , question_id ) : question = get_object_or_404 ( Question , pk = question_id ) if ( not question . allows_delete ( request . user ) ) : raise PermissionDenied if ( request . method == 'GET' ) : return render ( request , 'questions/confirm_question_delete.html' , { 'question' : question } ) product = question . product_slug log . warning ( ( 'User %s is deleting question with id=%s' % ( request . user , question . id ) ) ) question . delete ( ) statsd . incr ( 'questions.delete' ) return HttpResponseRedirect ( reverse ( 'questions.list' , args = [ product ] ) )
delete a question .