X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/3ba9e8fa774dcb586990f71986d8618631f3e5b1..9694fb0873b055992c5d2d00ff12f946b2f26c08:/forum/views/commands.py diff --git a/forum/views/commands.py b/forum/views/commands.py index 95895e3..c4c0326 100644 --- a/forum/views/commands.py +++ b/forum/views/commands.py @@ -1,20 +1,18 @@ +# -*- coding: utf-8 -*- + import datetime import logging -from forum import settings from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.utils import simplejson from django.utils.encoding import smart_unicode from django.utils.translation import ungettext, ugettext as _ -from django.http import HttpResponse, HttpResponseRedirect, Http404 +from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404, render_to_response -from django.template import RequestContext -from django.template.loader import render_to_string from forum.models import * -from forum.models.node import NodeMetaClass -from forum.utils.decorators import ajax_method, ajax_login_required +from forum.utils.decorators import ajax_login_required from forum.actions import * from forum.modules import decorate from forum import settings @@ -493,31 +491,6 @@ def subscribe(request, id, user=None): } } -@decorate.withfn(command) -def canned_comments(request, post_id): - user = request.user - - # Check whether the user has the required permissions to use the tool. - if not user.can_use_canned_comments: - raise CommandException(_("You cannot use the canned comments tool.")) - - if not request.POST: - canned_comments = [] - for comment in settings.CANNED_COMMENTS: - canned_comments.append(smart_unicode(comment)) - - return render_to_response('node/canned_comments.html', { - 'canned_comments' : canned_comments, - }, RequestContext(request)) - - comment = request.POST.get('comment', '') - - return { - 'commands' : { - 'canned_comment' : [post_id, comment], - } - } - #internally grouped views - used by the tagging system @ajax_login_required def mark_tag(request, tag=None, **kwargs):#tagging system