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())
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)
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)
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() )
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)
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 )