コード例 #1
0
ファイル: moderation.py プロジェクト: Locynaeh/weasyl
def modcontrol_massaction_(request):
    form = request.web_input(action='',
                             name='',
                             submissions=[],
                             characters=[],
                             journals=[])
    if form.action.startswith("zap-"):
        # "Zapping" cover art or thumbnails is not a bulk edit.
        if not form.submissions:
            raise WeasylError("Unexpected")
        submitid = int(form.submissions[0])
        type = form.action.split("zap-")[1]
        if type == "cover":
            moderation.removecoverart(request.userid, submitid)
        elif type == "thumb":
            moderation.removethumbnail(request.userid, submitid)
        elif type == "both":
            moderation.removecoverart(request.userid, submitid)
            moderation.removethumbnail(request.userid, submitid)
        else:
            raise WeasylError("Unexpected")
        raise HTTPSeeOther(location="/submission/%i" % (submitid, ))

    return Response(
        content_type='text/plain',
        body=moderation.bulk_edit(
            request.userid,
            form.action,
            map(int, form.submissions),
            map(int, form.characters),
            map(int, form.journals),
        ),
    )
コード例 #2
0
ファイル: moderation.py プロジェクト: 0x15/weasyl
    def POST(self):
        form = web.input(action='', name='', submissions=[], characters=[], journals=[])
        if form.action.startswith("zap-"):
            # "Zapping" cover art or thumbnails is not a bulk edit.
            if not form.submissions:
                raise WeasylError("Unexpected")
            submitid = int(form.submissions[0])
            type = form.action.split("zap-")[1]
            if type == "cover":
                moderation.removecoverart(self.user_id, submitid)
            elif type == "thumb":
                moderation.removethumbnail(self.user_id, submitid)
            elif type == "both":
                moderation.removecoverart(self.user_id, submitid)
                moderation.removethumbnail(self.user_id, submitid)
            else:
                raise WeasylError("Unexpected")
            raise web.seeother("/submission/%i" % (submitid,))

        return moderation.bulk_edit(
            self.user_id,
            form.action,
            map(int, form.submissions),
            map(int, form.characters),
            map(int, form.journals),
        )
コード例 #3
0
ファイル: moderation.py プロジェクト: makyo/weasyl
def modcontrol_massaction_(request):
    form = request.web_input(action='', name='', submissions=[], characters=[], journals=[])
    if form.action.startswith("zap-"):
        # "Zapping" cover art or thumbnails is not a bulk edit.
        if not form.submissions:
            raise WeasylError("Unexpected")
        submitid = int(form.submissions[0])
        type = form.action.split("zap-")[1]
        if type == "cover":
            moderation.removecoverart(request.userid, submitid)
        elif type == "thumb":
            moderation.removethumbnail(request.userid, submitid)
        elif type == "both":
            moderation.removecoverart(request.userid, submitid)
            moderation.removethumbnail(request.userid, submitid)
        else:
            raise WeasylError("Unexpected")
        raise HTTPSeeOther(location="/submission/%i" % (submitid,))

    return Response(
        content_type='text/plain',
        body=moderation.bulk_edit(
            request.userid,
            form.action,
            map(int, form.submissions),
            map(int, form.characters),
            map(int, form.journals),
        ),
    )
コード例 #4
0
    def POST(self):
        form = web.input(action='',
                         name='',
                         submissions=[],
                         characters=[],
                         journals=[])
        if form.action.startswith("zap-"):
            # "Zapping" cover art or thumbnails is not a bulk edit.
            if not form.submissions:
                raise WeasylError("Unexpected")
            submitid = int(form.submissions[0])
            type = form.action.split("zap-")[1]
            if type == "cover":
                moderation.removecoverart(self.user_id, submitid)
            elif type == "thumb":
                moderation.removethumbnail(self.user_id, submitid)
            elif type == "both":
                moderation.removecoverart(self.user_id, submitid)
                moderation.removethumbnail(self.user_id, submitid)
            else:
                raise WeasylError("Unexpected")
            raise web.seeother("/submission/%i" % (submitid, ))

        return moderation.bulk_edit(
            self.user_id,
            form.action,
            map(int, form.submissions),
            map(int, form.characters),
            map(int, form.journals),
        )