X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Flists.rpc.py;h=df5e22622581ea4f89c30aee4fe226480a277805;hb=77de31c98f05be58870afbaa0cb6ba9f6cbb1799;hp=e9529ae630a5c34093373a4ec3a2bbf725c60d1d;hpb=34c0246248ed6e3c6a372c89b359ce038bb95bc8;p=platal.git diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index e9529ae..df5e226 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -72,6 +72,7 @@ MYSQL_DB = get_config('Core', 'dbdb') PLATAL_DOMAIN = get_config('Mail', 'domain') PLATAL_DOMAIN2 = get_config('Mail', 'domain2', '') sys.stderr.write('PLATAL_DOMAIN = %s\n' % PLATAL_DOMAIN ) +sys.stderr.write("MYSQL_DB = %s\n" % MYSQL_DB) VHOST_SEP = get_config('Lists', 'vhost_sep', '_') ON_CREATE_CMD = get_config('Lists', 'on_create', '') @@ -148,7 +149,7 @@ class BasicAuthXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): userdesc = UserDesc(forlife, name, None, 0) return (userdesc, perms, vhost) else: - print "no user found for uid: %s, passwd: %s" % (uid, md5) + print >> sys.stderr, "no user found for uid: %s, passwd: %s" % (uid, md5) return None ################################################################################ @@ -242,7 +243,7 @@ def list_call_dispatcher(method, userdesc, perms, vhost, *arg): @root: the handler requires site admin rights """ try: - print "calling method: %s" % method + print >> sys.stderr, "calling method: %s" % method if has_annotation(method, "root") and perms != "admin": return 0 if has_annotation(method, "mlist"): @@ -297,7 +298,7 @@ def get_list_info(userdesc, perms, mlist, front_page=0): if not is_member and (mlist.subscribe_policy > 1): is_pending = list_call_locked(is_subscription_pending, userdesc, perms, mlist, False) if is_pending is 0: - return 0 + return None host = mlist.internal_name().split(VHOST_SEP)[0].lower() details = { @@ -413,7 +414,11 @@ def get_members(userdesc, perms, mlist): """ List the members of a list. @mlist """ - details, members = get_list_info(userdesc, perms, mlist) + infos = get_list_info(userdesc, perms, mlist) + if infos is None: + # Do not return None, this is not serializable + return 0 + details, members = infos members.sort() members = map(lambda member: (get_name(member), member), members) return (details, members, mlist.owner)