diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-05-05 02:10:45 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-05-05 02:10:45 -0400 |
commit | 9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99 (patch) | |
tree | 9ee2d285f8b0650485c35c827a0f4375881053b6 /askbot/management | |
parent | 54891e1576a3b8ad96fcfa159c5eaf5ab9cd2446 (diff) | |
download | askbot-9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99.tar.gz askbot-9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99.tar.bz2 askbot-9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99.zip |
hopefully fixed the askbot site mounted at a sub-url
Diffstat (limited to 'askbot/management')
3 files changed, 14 insertions, 13 deletions
diff --git a/askbot/management/commands/send_accept_answer_reminders.py b/askbot/management/commands/send_accept_answer_reminders.py index 2b8b0851..22ae311d 100644 --- a/askbot/management/commands/send_accept_answer_reminders.py +++ b/askbot/management/commands/send_accept_answer_reminders.py @@ -9,6 +9,7 @@ from django.utils.translation import ugettext as _ from django.utils.translation import ungettext from askbot import mail from askbot.utils.classes import ReminderSchedule +from askbot.utils.html import site_url from django.template import Context DEBUG_THIS_COMMAND = False @@ -67,7 +68,7 @@ class Command(NoArgsCommand): reminder_phrase = _('Please accept the best answer for these questions:') data = { - 'site_url': askbot_settings.APP_URL, + 'site_url': site_url(''),#here we need only the domain name 'questions': final_question_list, 'reminder_phrase': reminder_phrase } diff --git a/askbot/management/commands/send_email_alerts.py b/askbot/management/commands/send_email_alerts.py index 26f475a1..b7432296 100644 --- a/askbot/management/commands/send_email_alerts.py +++ b/askbot/management/commands/send_email_alerts.py @@ -14,6 +14,7 @@ from django.contrib.contenttypes.models import ContentType from askbot import const from askbot import mail from askbot.utils.slug import slugify +from askbot.utils.html import site_url DEBUG_THIS_COMMAND = False @@ -403,8 +404,6 @@ class Command(NoArgsCommand): else: num_q += 1 if num_q > 0: - url_prefix = askbot_settings.APP_URL - threads = Thread.objects.filter(id__in=[qq.thread_id for qq in q_list.keys()]) tag_summary = Thread.objects.get_tag_summary_from_threads(threads) @@ -452,7 +451,7 @@ class Command(NoArgsCommand): format_action_count('%(num)d ans rev',meta_data['ans_rev'],act_list) act_token = ', '.join(act_list) text += '<li><a href="%s?sort=latest">%s</a> <font color="#777777">(%s)</font></li>' \ - % (url_prefix + q.get_absolute_url(), q.thread.title, act_token) + % (site_url(q.get_absolute_url()), q.thread.title, act_token) text += '</ul>' text += '<p></p>' #if len(q_list.keys()) >= askbot_settings.MAX_ALERTS_PER_EMAIL: @@ -462,13 +461,13 @@ class Command(NoArgsCommand): # 'the askbot and see what\'s new!<br>' # ) - link = url_prefix + reverse( - 'user_subscriptions', - kwargs = { - 'id': user.id, - 'slug': slugify(user.username) - } - ) + link = reverse( + 'user_subscriptions', + kwargs = { + 'id': user.id, + 'slug': slugify(user.username) + } + ) text += _( '<p>Please remember that you can always <a ' @@ -477,7 +476,7 @@ class Command(NoArgsCommand): 'error, please email about it the forum administrator at %(admin_email)s.</' 'p><p>Sincerely,</p><p>Your friendly %(sitename)s server.</p>' ) % { - 'email_settings_link': link, + 'email_settings_link': site_url(link), 'admin_email': django_settings.ADMINS[0][1], 'sitename': askbot_settings.APP_SHORT_NAME } diff --git a/askbot/management/commands/send_unanswered_question_reminders.py b/askbot/management/commands/send_unanswered_question_reminders.py index 982dbafb..42ce5119 100644 --- a/askbot/management/commands/send_unanswered_question_reminders.py +++ b/askbot/management/commands/send_unanswered_question_reminders.py @@ -7,6 +7,7 @@ from django.utils.translation import ungettext from askbot import mail from askbot.utils.classes import ReminderSchedule from askbot.models.question import Thread +from askbot.utils.html import site_url from django.template import Context DEBUG_THIS_COMMAND = False @@ -72,7 +73,7 @@ class Command(NoArgsCommand): } data = { - 'site_url': askbot_settings.APP_URL, + 'site_url': site_url(''), 'questions': final_question_list, 'subject_line': subject_line } |