# HG changeset patch # User ymh # Date 1396396414 -7200 # Node ID 2876dcae02e49b46f4930a565cc084469e03ce8e # Parent 22791d0db35ed8e87ecdd1608c37c84362e94856 remove password link for egonomy external users diff -r 22791d0db35e -r 2876dcae02e4 src/egonomy/__init__.py --- a/src/egonomy/__init__.py Tue Apr 01 17:47:40 2014 +0200 +++ b/src/egonomy/__init__.py Wed Apr 02 01:53:34 2014 +0200 @@ -1,4 +1,4 @@ -VERSION = (0, 9, 1, "final", 0) +VERSION = (0, 9, 2, "final", 0) VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))) diff -r 22791d0db35e -r 2876dcae02e4 src/egonomy/templates/egonomy_base.html --- a/src/egonomy/templates/egonomy_base.html Tue Apr 01 17:47:40 2014 +0200 +++ b/src/egonomy/templates/egonomy_base.html Wed Apr 02 01:53:34 2014 +0200 @@ -1,5 +1,6 @@ {% load static %} {% load i18n %} +{% load egostringfilters %} @@ -83,7 +84,7 @@ {% if user.is_authenticated %} -
  • {% trans "Hello" %} {{ user.username }} +
  • {% trans "Hello" %} {% if user.username|startswith:EGONOMY_USER_PREFIX %}{{ user.username }}{% else %}{{ user.username }}{% endif %}
  • {% trans "Log out" %}
  • {% else %} diff -r 22791d0db35e -r 2876dcae02e4 src/egonomy/templatetags/egostringfilters.py --- a/src/egonomy/templatetags/egostringfilters.py Tue Apr 01 17:47:40 2014 +0200 +++ b/src/egonomy/templatetags/egostringfilters.py Wed Apr 02 01:53:34 2014 +0200 @@ -18,3 +18,11 @@ if autoescape: value = escape(value) return mark_safe(value.replace('\n', '\\n')) + +@register.filter +def startswith(value, arg): + """ + Returns True if the given string starts with an argument prefix, otherwise returns False. + """ + + return value.startswith(arg) \ No newline at end of file diff -r 22791d0db35e -r 2876dcae02e4 src/egonomy/utils/context_processors.py --- a/src/egonomy/utils/context_processors.py Tue Apr 01 17:47:40 2014 +0200 +++ b/src/egonomy/utils/context_processors.py Wed Apr 02 01:53:34 2014 +0200 @@ -19,5 +19,5 @@ url_parts[4] = urllib.urlencode(url_params, doseq=True) egonomy_url = urlparse.urlunparse(url_parts) - return {'VERSION': egonomy.get_version(), 'EGONOMY_URL': egonomy_url } + return {'VERSION': egonomy.get_version(), 'EGONOMY_URL': egonomy_url, 'EGONOMY_USER_PREFIX': getattr(settings, 'EGONOMY_USER_PREFIX', '')}