diff MoinMoin/themes/__init__.py @ 1063:ee71ed6e97c6 namespaces

change user.aliasname to user.display_name aliasname is a bit misleading now that name itself can be a list. but in moin 1.x, aliasname was always used for display purposes only, so display_name is a better name for it (see also displayName in LDAP) changed 1.9 importer to rename the key accordingly.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 05 Nov 2011 20:10:05 +0100
parents 5bf6d7a2ffcf
children 19f957844586
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Wed Nov 02 13:37:47 2011 -0200
+++ b/MoinMoin/themes/__init__.py	Sat Nov 05 20:10:05 2011 +0100
@@ -118,16 +118,13 @@
         Assemble arguments used to build user homepage link
 
         :rtype: tuple
-        :returns: arguments of user homepage link in tuple (wiki_href, aliasname, title, exists)
+        :returns: arguments of user homepage link in tuple (wiki_href, display_name, title, exists)
         """
         user = self.user
         name = user.name
-        aliasname = user.aliasname
-        if not aliasname:
-            aliasname = name
-
+        display_name = user.display_name or name
         wikiname, itemname = getInterwikiHome(name)
-        title = "{0} @ {1}".format(aliasname, wikiname)
+        title = "{0} @ {1}".format(display_name, wikiname)
         # link to (interwiki) user homepage
         if is_local_wiki(wikiname):
             exists = self.storage.has_item(itemname)
@@ -135,7 +132,7 @@
             # We cannot check if wiki pages exists in remote wikis
             exists = True
         wiki_href = url_for_item(itemname, wiki_name=wikiname)
-        return wiki_href, aliasname, title, exists
+        return wiki_href, display_name, title, exists
 
     def split_navilink(self, text):
         """
@@ -295,14 +292,12 @@
         u = user.User(userid)
         name = u.name
         text = name
-        aliasname = u.aliasname
-        if not aliasname:
-            aliasname = name
+        display_name = u.display_name or name
         if title:
             # we already have some address info
-            title = "{0} @ {1}".format(aliasname, title)
+            title = "{0} @ {1}".format(display_name, title)
         else:
-            title = aliasname
+            title = display_name
         if u.mailto_author and u.email:
             email = u.email
             css = 'editor mail'