changeset 6033:f70b9ab3dedc

fix return type of get_by_... lookup functions (must be User obj or None)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 28 Feb 2014 19:38:41 +0100
parents 9248e31d7a95
children f77842ede10f
files MoinMoin/user.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/user.py	Fri Feb 14 17:24:43 2014 +0100
+++ b/MoinMoin/user.py	Fri Feb 28 19:38:41 2014 +0100
@@ -69,11 +69,15 @@
 
 def get_by_email_address(request, email_address):
     """ Searches for an user with a particular e-mail address and returns it. """
-    return _getUserIdByKey(request, 'email', email_address, case=False)
+    uid = _getUserIdByKey(request, 'email', email_address, case=False)
+    if uid is not None:
+        return User(request, uid)
 
 def get_by_jabber_id(request, jabber_id):
     """ Searches for an user with a perticular jabber id and returns it. """
-    return _getUserIdByKey(request, 'jid', jabber_id, case=False)
+    uid = _getUserIdByKey(request, 'jid', jabber_id, case=False)
+    if uid is not None:
+        return User(request, uid)
 
 def _getUserIdByKey(request, key, search, case=True):
     """ Get the user ID for a specified key/value pair.