]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixing some encoding/decoding errors, including the akismate module, and fixed the...
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 10:29:24 +0000 (10:29 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 10:29:24 +0000 (10:29 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@324 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/templates/ask.html
forum/skins/default/templates/search.html [new file with mode: 0644]
forum/views/decorators.py
forum_modules/akismet/startup.py

index 87453314745a5eb18f08944c96c62450d44e0bfa..5c12c865142b6a1f5f90689e1c2045ddf6f1224f 100644 (file)
@@ -68,7 +68,7 @@
 </div>
 <div id="main-body" class="ask-body">
     <div id="askform">
-        <form id="fmask" action="" method="post" >
+        <form id="fmask" action="" method="post" accept-charset="utf-8">
                        {% if not request.user.is_authenticated %}
             <div class="message">
                            <p>{% trans "login to post question info" %}</p>
diff --git a/forum/skins/default/templates/search.html b/forum/skins/default/templates/search.html
new file mode 100644 (file)
index 0000000..e413abd
--- /dev/null
@@ -0,0 +1,25 @@
+{% extends "base_content.html" %}
+
+{% load i18n %}
+
+{% block content %}
+<div id="main-bar" class="headNormal">
+       {% blocktrans with settings.APP_SHORT_NAME as app_name %}
+           Search in {{  app_name }}
+       {%  endblocktrans %}
+</div>
+<div id="main-body" style="text-align: center; height: 400px;">
+<form action="{% url search %}" method="get">
+    <div>
+        <input type="text" class="searchInput" value="{{ keywords }}" name="q" id="keywords" style="width: 600px" />
+        <input type="submit" name="Submit" value="{% trans "search" %}" class="searchBtn" />
+    </div>
+    <div class="options">
+        <input id="type-question" type="radio" value="question" name="t"
+            checked="checked" /><label for="type-question">{% trans "questions" %}</label>
+        <input id="type-tag" type="radio" value="tag" name="t" /><label for="type-tag">{% trans "tags" %}</label>
+        <input id="type-user" type="radio" value="user" name="t" /><label for="type-user">{% trans "users" %}</label>
+    </div>
+</form>
+</div>
+{% endblock %}
\ No newline at end of file
index f9929ffacde158b7175c91f441d139f160e02853..37413d29e6872039ef10830ef3746b7b900b1ea9 100644 (file)
@@ -81,7 +81,7 @@ def command(func):
             if isinstance(e, CommandException):\r
                 response = {\r
                     'success': False,\r
-                    'error_message': str(e)\r
+                    'error_message': e.message\r
                 }\r
             else:\r
                 logging.error("%s: %s" % (func.__name__, str(e)))\r
index 0688746ba16fe291ecc5535857ba51bd41001faa..1e9e731e76eeee83bbc54074b6f7673d05df67fa 100644 (file)
@@ -1,6 +1,7 @@
 from django.utils.translation import ugettext as _
 from django.http import HttpResponse, HttpResponseRedirect
 from django.utils import simplejson
+from django.utils.encoding import smart_str
 from django.shortcuts import render_to_response
 from forum.modules.decorators import decorate
 from forum import views
@@ -15,8 +16,8 @@ import settings
 def check_spam(param, comment_type):
     def wrapper(origin, request, *args, **kwargs):
         if (request.POST and request.POST.get(param, None) and WORDPRESS_API_KEY) and (not request.user.is_authenticated()
-             or not (request.user.is_staff and request.user.is_superuser and request.user.reputation >= REP_FOR_NO_SPAM_CHECK)):
-            comment = request.POST[param]
+             or not (request.user.is_staff or request.user.is_superuser or request.user.reputation >= REP_FOR_NO_SPAM_CHECK)):
+            comment = smart_str(request.POST[param])
 
             data = {
                 "user_ip":request.META["REMOTE_ADDR"],
@@ -27,7 +28,7 @@ def check_spam(param, comment_type):
 
             if request.user.is_authenticated():
                 data.update({
-                    "comment_author":request.user.username,
+                    "comment_author":smart_str(request.user.username),
                     "comment_author_email":request.user.email,
                     "comment_author_url":request.user.website,    
                 })