示例#1
0
 def post(self, request, *args, **kwargs):
     premise = self.get_premise()
     premise.supporters.add(self.request.user)
     supported_a_premise.send(sender=self,
                              premise=premise,
                              user=self.request.user)
     return redirect(self.get_contention())
示例#2
0
 def post(self, request, *args, **kwargs):
     premise = self.get_premise()
     premise.supporters.add(self.request.user)
     supported_a_premise.send(sender=self,
                              premise=premise,
                              user=self.request.user)
     return redirect(premise.get_parent().get_absolute_url() +
                     self.get_next_parameter() + "#%s" % premise.pk)
示例#3
0
 def support(self, request, pk=None, premise_id=None):
     premise = self.get_object()
     if premise.supporters.filter(id=request.user.id).exists():
         return Response({'message': "Onermeyi Zaten destekliyorsun"},
                         status=status.HTTP_400_BAD_REQUEST)
     premise.supporters.add(request.user)
     supported_a_premise.send(sender=self, premise=premise,
                              user=self.request.user)
     return Response(status=status.HTTP_201_CREATED)
示例#4
0
 def post(self, request, *args, **kwargs):
     premise = self.get_premise()
     premise.supporters.add(self.request.user)
     supported_a_premise.send(sender=self, premise=premise,
                              user=self.request.user)
     return redirect(
         premise.get_parent().get_absolute_url() +
         self.get_next_parameter()
     )
示例#5
0
    def post(self, request, *args, **kwargs):
        premise = self.get_premise()
        premise.supporters.add(self.request.user)
        supported_a_premise.send(sender=self,
                                 premise=premise,
                                 user=self.request.user)
        premise.argument.update_premise_weights()

        if request.is_ajax():
            return HttpResponse(status=201)

        return redirect(premise.get_parent().get_absolute_url() +
                        self.get_next_parameter() + "#%s" % premise.pk)
示例#6
0
    def post(self, request, *args, **kwargs):
        premise = self.get_premise()
        premise.supporters.add(self.request.user)
        supported_a_premise.send(sender=self, premise=premise,
                                 user=self.request.user)
        premise.argument.update_premise_weights()

        if request.is_ajax():
            return HttpResponse(status=201)

        return redirect(
            premise.get_parent().get_absolute_url() +
            self.get_next_parameter() +
            "#%s" % premise.pk
        )
示例#7
0
 def post(self, request, *args, **kwargs):
     premise = self.get_premise()
     premise.supporters.add(self.request.user)
     supported_a_premise.send(sender=self, premise=premise,
                              user=self.request.user)
     return redirect(self.get_contention())