예제 #1
0
 def post(self, *args, **kwargs):
     """ safe guard for POST to make sure only owner can delete his own poll """
     question = get_object_or_404(Question,pk=kwargs['pk'])
     
     if question.created_by == self.request.user :
         return DeleteView.post(self, *args, **kwargs)
     else :
         return HttpResponseForbidden('you are not allowed to do this')
예제 #2
0
 def post(self, request, *args, **kwargs):
     DeleteView.post(self, request, *args, **kwargs)
     return JsonResponse({})
예제 #3
0
 def post(self, request, *args, **kwargs):
     logout(request)
     messages.add_message(request, messages.SUCCESS, 'Пользователь удалён')
     return DeleteView.post(self, request, *args, **kwargs)