From: Radek Czajka Date: Mon, 14 Jan 2013 12:07:43 +0000 (+0100) Subject: random fixes X-Git-Url: https://git.mdrn.pl/cas.git/commitdiff_plain/f8a5c883f22ee53fc0b5ac207c34cf908a3f0631?ds=sidebyside random fixes --- diff --git a/provider/cas_provider/templates/cas/login.html b/provider/cas_provider/templates/cas/login.html index d61974a..42b5708 100644 --- a/provider/cas_provider/templates/cas/login.html +++ b/provider/cas_provider/templates/cas/login.html @@ -5,7 +5,7 @@ Login {% endblock %} {% block content %} -
+
Log in to your account {% if errors %} diff --git a/provider/cas_provider/urls.py b/provider/cas_provider/urls.py index 2bdbe79..2b53f31 100644 --- a/provider/cas_provider/urls.py +++ b/provider/cas_provider/urls.py @@ -3,8 +3,8 @@ from django.conf.urls.defaults import * from cas_provider.views import * urlpatterns = patterns('', - url(r'^login/$', login), - url(r'^validate/$', validate), - url(r'^serviceValidate/$', service_validate), - url(r'^logout/$', logout), -) \ No newline at end of file + url(r'^login/?$', login, name='cas_login'), + url(r'^validate/?$', validate), + url(r'^serviceValidate/?$', service_validate), + url(r'^logout/?$', logout), +) diff --git a/provider/cas_provider/views.py b/provider/cas_provider/views.py index e2466b8..3a9ab5a 100644 --- a/provider/cas_provider/views.py +++ b/provider/cas_provider/views.py @@ -4,6 +4,7 @@ from django.template import RequestContext from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.contrib.auth import login as auth_login, logout as auth_logout +from django.utils.encoding import smart_str from django.utils.translation import ugettext_lazy as _ from cas_provider.forms import LoginForm @@ -24,7 +25,7 @@ __all__ = ['login', 'validate', 'service_validate', 'logout'] def _add_query_param(url, param, value): parsed = urlparse.urlparse(url) - query = url_parse_qs(parsed.query) + query = url_parse_qs(smart_str(parsed.query)) query[param] = [unicode(value, 'utf-8')] query = [ ((k, v) if len(v) != 1 else (k, v[0])) for k, v in query.iteritems() ] parsed = urlparse.ParseResult(parsed.scheme, parsed.netloc, diff --git a/src/accounts/templatetags/gravatar.py b/src/accounts/templatetags/gravatar.py index 93a1ebf..789534f 100644 --- a/src/accounts/templatetags/gravatar.py +++ b/src/accounts/templatetags/gravatar.py @@ -19,7 +19,7 @@ class GravatarNode(template.Node): except template.VariableDoesNotExist: return '' - gravatar_url = "http://www.gravatar.com/avatar/" + hashlib.md5(email).hexdigest() + "?" + gravatar_url = "https://www.gravatar.com/avatar/" + hashlib.md5(email).hexdigest() + "?" gravatar_url += urllib.urlencode({'default': 'mm', 'size': str(self.size)}) return gravatar_url diff --git a/src/cas/templates/cas/login.html b/src/cas/templates/cas/login.html index 7a51cac..514c5a3 100644 --- a/src/cas/templates/cas/login.html +++ b/src/cas/templates/cas/login.html @@ -3,7 +3,7 @@ {% block content %} - +

{% trans "Login" %}

{% for error in errors %}