changeset 3584:5be4f4a8fa65

SystemAdmin user browser: handle empty email/jabber addresses correctly
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 12 May 2008 13:33:21 +0200
parents 347dff3b8197
children fc32d580fe37
files MoinMoin/userform/admin.py
diffstat 1 files changed, 24 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/userform/admin.py	Sun May 11 23:37:34 2008 +0200
+++ b/MoinMoin/userform/admin.py	Mon May 12 13:33:21 2008 +0200
@@ -65,24 +65,34 @@
                                              },
                                     rel='nofollow')
 
-        mail_link = request.page.link_to(
-                        request, text=_('Mail account data'),
-                        querystr={"action": "recoverpass",
-                                  "email": account.email,
-                                  "account_sendmail": "1",
-                                  "sysadm": "users", },
-                        rel='nofollow')
+        recoverpass_link = request.page.link_to(
+                            request, text=_('Mail account data'),
+                            querystr={"action": "recoverpass",
+                                      "email": account.email,
+                                      "account_sendmail": "1",
+                                      "sysadm": "users", },
+                            rel='nofollow')
+
+        if account.email:
+            email_link = (request.formatter.url(1, 'mailto:' + account.email, css='mailto') +
+                          request.formatter.text(account.email) +
+                          request.formatter.url(0))
+        else:
+            email_link = ''
+
+        if account.jid:
+            jabber_link =  (request.formatter.url(1, 'xmpp:' + account.jid, css='mailto') +
+                            request.formatter.text(account.jid) +
+                            request.formatter.url(0))
+        else:
+            jabber_link = ''
 
         data.addRow((
             request.formatter.rawHTML(namelink),
             request.formatter.rawHTML(list_groups),
-            (request.formatter.url(1, 'mailto:' + account.email, css='mailto') +
-             request.formatter.text(account.email) +
-             request.formatter.url(0)),
-            (request.formatter.url(1, 'xmpp:' + account.jid, css='mailto') +
-             request.formatter.text(account.jid) +
-             request.formatter.url(0)),
-            mail_link + " - " + enable_disable_link
+            email_link,
+            jabber_link,
+            recoverpass_link + " - " + enable_disable_link
         ))
 
     if data: