Example #1
0
    def post(self,request,*args,**kwargs):
        from managers.models import ModerationReport

        self.list = PhotoList.objects.get(uuid=self.kwargs["uuid"])
        if request.is_ajax() and not ModerationReport.is_user_already_reported(request.user.pk, 'PHL', self.list.pk):
            description = request.POST.get('description')
            type = request.POST.get('type')
            ModerationReport.create_moderation_report(reporter_id=request.user.pk, _type="PHL", object_id=self.list.pk, description=description, type=type)
            return HttpResponse()
        else:
            return HttpResponseBadRequest()
Example #2
0
    def post(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        music = Music.objects.get(pk=self.kwargs["pk"])
        if request.is_ajax() and not ModerationReport.is_user_already_reported(
                request.user.pk, 'MUS', music.pk):
            ModerationReport.create_moderation_report(
                reporter_id=request.user.pk,
                _type="MUS",
                object_id=music.pk,
                description=request.POST.get('description'),
                type=request.POST.get('type'))
            return HttpResponse()
        else:
            return HttpResponseBadRequest()
Example #3
0
    def post(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        form = ReportForm(request.POST)
        if request.is_ajax() and not ModerationReport.is_user_already_reported(
                request.user.pk, 'COM', self.kwargs["pk"]):
            mod = form.save(commit=False)
            ModerationReport.create_moderation_report(
                reporter_id=request.user.pk,
                _type="COM",
                object_id=self.kwargs["pk"],
                description=mod.description,
                type=request.POST.get('type'))
            return HttpResponse()
        else:
            return HttpResponseBadRequest()
Example #4
0
    def get(self,request,*args,**kwargs):
        from managers.models import ModerationReport

        self.list = PhotoList.objects.get(uuid=self.kwargs["uuid"])
        self.is_reported = ModerationReport.is_user_already_reported(request.user.pk, 'PHL', self.list.pk)
        self.template_name = get_detect_platform_template("managers/manage_create/photo/list_claim.html", request.user, request.META['HTTP_USER_AGENT'])
        return super(ListPhotoClaimCreate,self).get(request,*args,**kwargs)
Example #5
0
    def post(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        comment = ElectNewComment.objects.get(pk=self.kwargs["pk"])
        if request.is_ajax() and not ModerationReport.is_user_already_reported(
                request.user.pk, 'ELEC', comment.pk):
            description = request.POST.get('description')
            type = request.POST.get('type')
            ModerationReport.create_moderation_report(
                reporter_id=request.user.pk,
                _type="ELEC",
                object_id=comment.pk,
                description=description,
                type=type)
            return HttpResponse()
        else:
            return HttpResponseBadRequest()
Example #6
0
    def get(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        self.template_name = get_detect_platform_template(
            "managers/manage_create/elect_new/elect_new_claim.html",
            request.user, request.META['HTTP_USER_AGENT'])
        self.new = ElectNew.objects.get(pk=self.kwargs["pk"])
        self.is_reported = ModerationReport.is_user_already_reported(
            request.user.pk, 'ELE', self.new.pk)
        return super(ElectNewClaimCreate, self).get(request, *args, **kwargs)
Example #7
0
    def get(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        self.track = Music.objects.get(pk=self.kwargs["pk"])
        self.is_reported = ModerationReport.is_user_already_reported(
            request.user.pk, 'MUL', self.track.pk)
        self.template_name = get_detect_platform_template(
            "managers/manage_create/audio/audio_claim.html", request.user,
            request.META['HTTP_USER_AGENT'])
        return super(AudioClaimCreate, self).get(request, *args, **kwargs)
Example #8
0
    def get(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        self.survey = Survey.objects.get(uuid=self.kwargs["uuid"])
        self.is_reported = ModerationReport.is_user_already_reported(
            request.user.pk, 'SUR', self.survey.pk)
        self.template_name = get_detect_platform_template(
            "managers/manage_create/survey/survey_claim.html", request.user,
            request.META['HTTP_USER_AGENT'])
        return super(SurveyClaimCreate, self).get(request, *args, **kwargs)
Example #9
0
    def get(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        self.comment = BlogComment.objects.get(pk=self.kwargs["pk"])
        self.is_reported = ModerationReport.is_user_already_reported(
            request.user.pk, 'BLOC', self.comment.pk)
        self.template_name = get_detect_platform_template(
            "managers/manage_create/blog/comment_claim.html", request.user,
            request.META['HTTP_USER_AGENT'])
        return super(CommentBlogClaimCreate, self).get(request, *args,
                                                       **kwargs)
Example #10
0
    def get(self, request, *args, **kwargs):
        from managers.models import ModerationReport

        self.organization = Organization.objects.get(pk=self.kwargs["pk"])
        self.is_reported = ModerationReport.is_user_already_reported(
            request.user.pk, 'ORG', self.organization.pk)
        self.template_name = get_detect_platform_template(
            "managers/manage_create/organization/organization_claim.html",
            request.user, request.META['HTTP_USER_AGENT'])
        return super(OrganizationClaimCreate,
                     self).get(request, *args, **kwargs)