Exemple #1
0
def whitelisting_deny(request, comment_id, disable_author=False):
    comment = get_object_or_404(QuestComment.all_objects, id=comment_id)
    models.deny(request.user, comment)

    if disable_author:
        author = comment.author
        author.is_active = False
        author.save()
        author.userinfo.details.force()

        UserModerationLog.append(
            user=author,
            moderator=request.user,
            action=UserModerationLog.Actions.warn,
        )
Exemple #2
0
def whitelisting_deny(request, comment_id, disable_author=False):
    comment = get_object_or_404(QuestComment.all_objects, id=comment_id)
    models.deny(request.user, comment)

    if disable_author:
        author = comment.author
        author.is_active = False
        author.save()
        author.userinfo.details.force()

        UserModerationLog.append(
            user=author,
            moderator=request.user,
            action=UserModerationLog.Actions.warn,
        )
Exemple #3
0
def whitelisting_deny(request, comment_id, disable_author=False):
    try:
        comment = QuestComment.all_objects.get(id=comment_id)
    except QuestComment.DoesNotExist:
        comment = get_object_or_404(Quest.all_objects, id=comment_id)

    models.deny(comment, moderator=request.user)

    if disable_author:
        author = comment.author
        author.is_active = False
        author.save()
        author.userinfo.details.force()

        UserModerationLog.append(
            user=author,
            moderator=request.user,
            action=UserModerationLog.Actions.deactivate_user,
        )

        for comment in author.comments.all():
            models.deny(comment)