from django.utils.translation import ungettext, ugettext as _
from django.core.urlresolvers import reverse
from django.db.models import F
+from django.contrib import messages
from forum.models.action import ActionProxy
from forum.models import Award, Badge, ValidationHash, User
from forum import settings, REQUEST_HOLDER
return _("%(user)s suspended %(users)s %(suspension)s: %(msg)s") % {
'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)),
'users': self.affected_links(viewer), 'suspension': suspension, 'msg': self.extra.get('publicmsg', _('Bad behaviour'))
- }
\ No newline at end of file
+ }
{% htmlcontent notifications/base.html %}
<p style="{{ p_style }}">{% trans "Please use the following link to help us verify your email address:" %}</p>
- <p style="{{ p_style }}"><a style="{{ a_style }}" href="{% fullurl auth_validate_email user=recipient.id,code=validation_code %}">{% trans "Validate my email address" %}</a></p>
+ <p style="{{ p_style }}"><a style="{{ a_style }}" href="{% fullurl "auth_validate_email" user=recipient.id code=validation_code %}">{% trans "Validate my email address" %}</a></p>
<p style="{{ p_style }}">{% trans "If the above link is not clickable, copy and paste this url into your web browser's address bar:" %}</p>
- <p style="{{ p_style }}">{% fullurl auth_validate_email user=recipient.id,code=validation_code %}</p>
+ <p style="{{ p_style }}">{% fullurl "auth_validate_email" user=recipient.id code=validation_code %}</p>
{% endhtmlcontent %}
{% textcontent notifications/base_text.html %}
{% trans "Copy and paste this url into your web browser's address bar to help us verify your email address:" %}
-{% fullurl auth_validate_email user=recipient.id,code=validation_code %}
+{% fullurl "auth_validate_email" user=recipient.id code=validation_code %}
{% endtextcontent %}
{% endemail %}
<p style="{{ p_style }}">
{% blocktrans %}The following link grants you a one time access to your account at {{ app_name }}.{% endblocktrans %}
</p>
- <p style="{{ p_style }}"><a style="{{ a_style }}" href="{% fullurl auth_tempsignin user=recipient.id,code=temp_login_code %}">{% trans "Go to your account" %}</a></p>
+ <p style="{{ p_style }}"><a style="{{ a_style }}" href="{% fullurl "auth_tempsignin" user=recipient.id code=temp_login_code %}">{% trans "Go to your account" %}</a></p>
<p style="{{ p_style }}">{% trans "If the above link is not clickable, copy and paste this url into your web browser's address bar:" %}</p>
- <p style="{{ p_style }}">{% fullurl auth_tempsignin user=recipient.id,code=temp_login_code %}</p>
+ <p style="{{ p_style }}">{% fullurl "auth_tempsignin" user=recipient.id code=temp_login_code %}</p>
{% endhtmlcontent %}
{% textcontent notifications/base_text.html %}
{% blocktrans %}The following url grants you a one time access to your account at {{ app_name }}.{% endblocktrans %}
-{% fullurl auth_tempsignin user=recipient.id,code=temp_login_code %}
+{% fullurl "auth_tempsignin" user=recipient.id code=temp_login_code %}
{% endtextcontent %}
{% endemail %}
def media(request, skin, path):
response = serve(request, "%s/media/%s" % (skin, path),
document_root=os.path.join(os.path.dirname(os.path.dirname(__file__)), 'skins').replace('\\', '/'))
- content_type = response['Content-Type']
+ content_type = response.get('Content-Type', '')
if ('charset=' not in content_type):
if (content_type.startswith('text') or content_type=='application/x-javascript'):
content_type += '; charset=utf-8'
from django.template import RequestContext
from django import template
from django.utils.html import *
+from django.utils.http import urlquote
from django.db.models import Q, Count
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
import json
-import loggin
from django.utils.translation import ugettext as _
from django.http import HttpResponse, HttpResponseRedirect
import settings
urlpatterns = patterns('',
- (r'^robots.txt$', lambda r: HttpResponse(settings.ROBOTS_FILE.value)),
+ (r'^robots.txt$', lambda r: HttpResponse(settings.ROBOTS_FILE.value, content_type='text/plain')),
)
USE_I18N = True
LANGUAGE_CODE = 'en'
-DJANGO_VERSION = 1.1
OSQA_DEFAULT_SKIN = 'default'
DISABLED_MODULES = ['books', 'recaptcha', 'project_badges']