From 9abc54767e0115c2e6860c0c4d407e6cf832fd05 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sat, 28 Aug 2010 13:53:08 -0400 Subject: fixed a few small issues: bug in edit wiki post, allow hyphen in user name and a small page formatting bug --- askbot/const/__init__.py | 2 +- askbot/templatetags/extra_tags.py | 4 ++-- askbot/views/writers.py | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/askbot/const/__init__.py b/askbot/const/__init__.py index 8742cf56..06c7e497 100644 --- a/askbot/const/__init__.py +++ b/askbot/const/__init__.py @@ -202,7 +202,7 @@ NOTIFICATION_DELIVERY_SCHEDULE_CHOICES= ( ) USERS_PAGE_SIZE = 28#todo: move it to settings? -USERNAME_REGEX_STRING = r'^[\w ]+$' +USERNAME_REGEX_STRING = r'^[\w \-]+$' #chars that can go before or after @mention TWITTER_STYLE_MENTION_TERMINATION_CHARS = '\n ;,.!?<>' diff --git a/askbot/templatetags/extra_tags.py b/askbot/templatetags/extra_tags.py index fe1e5cb2..770ffe0b 100644 --- a/askbot/templatetags/extra_tags.py +++ b/askbot/templatetags/extra_tags.py @@ -221,8 +221,8 @@ def get_score_badge_by_details(rep, gold_count, silver_count, bronze_count): #this one is used for the header next to user profile and logout links REP_TEMPLATE2 = '' \ - + '%(rep_word)s: %(reputation)s ' -BADGE_TEMPLATE2 = '' \ + + '%(rep_word)s: %(reputation)s' +BADGE_TEMPLATE2 = ' ' \ + '%(badge_counters)s' @register.simple_tag def get_long_score_and_badge_report(user): diff --git a/askbot/views/writers.py b/askbot/views/writers.py index c1156170..dc40e2b6 100644 --- a/askbot/views/writers.py +++ b/askbot/views/writers.py @@ -237,7 +237,7 @@ def edit_question(request, id): body_text = form.cleaned_data['text'], revision_comment = form.cleaned_data['summary'], tags = form.cleaned_data['tags'], - wiki = form.cleaned_data['wiki'] + wiki = form.cleaned_data.get('wiki', question.wiki) ) return HttpResponseRedirect(question.get_absolute_url()) else: @@ -292,7 +292,8 @@ def edit_answer(request, id): answer = answer, body_text = form.cleaned_data['text'], revision_comment = form.cleaned_data['summary'], - wiki = False,#todo: add wiki field to form + wiki = form.cleaned_data.get('wiki', answer.wiki), + #todo: add wiki field to form ) return HttpResponseRedirect(answer.get_absolute_url()) else: -- cgit v1.2.3-1-g7c22