From: hernani Date: Wed, 26 May 2010 18:43:06 +0000 (+0000) Subject: Fixes OSQA 282, Error in related_questions. X-Git-Tag: live~797 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/d7a18910f5d471a3fa37f3a1cf202fa5302ac25f Fixes OSQA 282, Error in related_questions. Show wiki checkbox in answer edit form. Don't answer default to wiki when question is wiki. Add type to badges without type. Make first user staff as well. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@335 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/templates/answer_edit.html b/forum/skins/default/templates/answer_edit.html index 6414200..137b684 100644 --- a/forum/skins/default/templates/answer_edit.html +++ b/forum/skins/default/templates/answer_edit.html @@ -51,7 +51,13 @@ {{ form.text }}
{% trans "toggle preview" %}
+ title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %} + {% if settings.WIKI_ON %} +
+ {{ form.wiki }} {{ form.wiki.label_tag }} +
+ {% endif %} +
diff --git a/forum/views/auth.py b/forum/views/auth.py index 477f16d..26ce783 100644 --- a/forum/views/auth.py +++ b/forum/views/auth.py @@ -147,6 +147,7 @@ def external_register(request): if User.objects.all().count() == 0: user_.is_superuser = True + user_.is_staff = True user_.save() UserJoinsAction(user=user_, ip=request.META['REMOTE_ADDR']).save() diff --git a/forum_modules/default_badges/badges.py b/forum_modules/default_badges/badges.py index a041776..279f778 100644 --- a/forum_modules/default_badges/badges.py +++ b/forum_modules/default_badges/badges.py @@ -108,6 +108,7 @@ class FavoriteQuestion(FavoriteQuestionBadge): expected_count = settings.FAVORITE_QUESTION_FAVS class StellarQuestion(FavoriteQuestionBadge): + type = Badge.GOLD name = _("Stellar Question") expected_count = settings.STELLAR_QUESTION_FAVS @@ -237,6 +238,7 @@ class SelfLearner(AbstractBadge): class StrunkAndWhite(AbstractBadge): + type = Badge.SILVER award_once = True listen_to = (ReviseAction,) name = _("Strunk & White") diff --git a/forum_modules/pgfulltext/handlers.py b/forum_modules/pgfulltext/handlers.py index fc64bac..e46c571 100644 --- a/forum_modules/pgfulltext/handlers.py +++ b/forum_modules/pgfulltext/handlers.py @@ -4,7 +4,7 @@ from forum.modules.decorators import decorate @decorate(QuestionManager.search, needs_origin=False) def question_search(self, keywords): - tsquery = " | ".join(keywords.split(' ')) + tsquery = " | ".join([k for k in keywords.split(' ') if k]) return self.extra( tables = ['forum_rootnode_doc'],