summaryrefslogtreecommitdiffstats
path: root/askbot/management/commands/askbot_clear_moderation_queue.py
blob: c767e670c9a57b14ec6b55eb9f8f8d1984de4769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from django.core.management.base import NoArgsCommand
from askbot import const
from askbot.models import Activity

ACTIVITY_TYPES = (
    const.TYPE_ACTIVITY_MODERATED_NEW_POST,
    const.TYPE_ACTIVITY_MODERATED_POST_EDIT,
    const.TYPE_ACTIVITY_MARK_OFFENSIVE
)

class Command(NoArgsCommand):
    help = 'deletes all items from the moderation queue'
    def handle_noargs(self, *args, **kwargs):
        acts = Activity.objects.filter(activity_type__in=ACTIVITY_TYPES)
        acts.delete()