changeset 1609:dc7c76f163ad

add EDIT_ROWS and CSS_URL to the list of attr names proxied, fixes #222
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 04 Aug 2012 20:14:35 +0200
parents d37fb6088f09
children 4374108a1189
files MoinMoin/constants/keys.py MoinMoin/user.py
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/constants/keys.py	Sat Aug 04 21:58:12 2012 +0530
+++ b/MoinMoin/constants/keys.py	Sat Aug 04 20:14:35 2012 +0200
@@ -83,9 +83,19 @@
 EDIT_ON_DOUBLECLICK = "edit_on_doubleclick"
 SHOW_COMMENTS = "show_comments"
 MAILTO_AUTHOR = "mailto_author"
+CSS_URL = "css_url"
+EDIT_ROWS = "edit_rows"
 RESULTS_PER_PAGE = "results_per_page"
 DISABLED = "disabled"
 
+USEROBJ_ATTRS = [
+    # User objects proxy these attributes of the UserProfile objects:
+    NAME, DISABLED, ITEMID, ALIASNAME, ENC_PASSWORD, EMAIL, OPENID,
+    MAILTO_AUTHOR, SHOW_COMMENTS, RESULTS_PER_PAGE, EDIT_ON_DOUBLECLICK,
+    EDIT_ROWS, THEME_NAME, LOCALE, TIMEZONE, SUBSCRIBED_ITEMS, QUICKLINKS,
+    CSS_URL,
+]
+
 # keys for blog homepages
 LOGO = "logo"
 SUPERTAGS = "supertags"
--- a/MoinMoin/user.py	Sat Aug 04 21:58:12 2012 +0530
+++ b/MoinMoin/user.py	Sat Aug 04 20:14:35 2012 +0200
@@ -318,10 +318,7 @@
         """
         delegate some lookups into the .profile
         """
-        if name in [NAME, DISABLED, ITEMID, ALIASNAME, ENC_PASSWORD, EMAIL, OPENID,
-                    MAILTO_AUTHOR, SHOW_COMMENTS, RESULTS_PER_PAGE, EDIT_ON_DOUBLECLICK,
-                    THEME_NAME, LOCALE, TIMEZONE, SUBSCRIBED_ITEMS, QUICKLINKS,
-                   ]:
+        if name in USEROBJ_ATTRS:
             try:
                 return self.profile[name]
             except KeyError: