projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ensure that UFC_SchoolId is exportable
[platal.git]
/
bin
/
lists.rpc.py
diff --git
a/bin/lists.rpc.py
b/bin/lists.rpc.py
index
00b498c
..
56067ba
100755
(executable)
--- a/
bin/lists.rpc.py
+++ b/
bin/lists.rpc.py
@@
-1,6
+1,6
@@
#!/usr/bin/env python
#***************************************************************************
#!/usr/bin/env python
#***************************************************************************
-#* Copyright (C) 2003-201
0
Polytechnique.org *
+#* Copyright (C) 2003-201
1
Polytechnique.org *
#* http://opensource.polytechnique.org/ *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* http://opensource.polytechnique.org/ *
#* *
#* This program is free software; you can redistribute it and/or modify *
@@
-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 )
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', '')
VHOST_SEP = get_config('Lists', 'vhost_sep', '_')
ON_CREATE_CMD = get_config('Lists', 'on_create', '')
@@
-166,6
+167,7
@@
def connectDB():
passwd=MYSQL_PASS,
unix_socket='/var/run/mysqld/mysqld.sock')
db.ping()
passwd=MYSQL_PASS,
unix_socket='/var/run/mysqld/mysqld.sock')
db.ping()
+ db.autocommit(True)
return db.cursor()
def mysql_fetchone(query):
return db.cursor()
def mysql_fetchone(query):
@@
-297,7
+299,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:
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 = {
host = mlist.internal_name().split(VHOST_SEP)[0].lower()
details = {
@@
-413,7
+415,11
@@
def get_members(userdesc, perms, mlist):
""" List the members of a list.
@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)
members.sort()
members = map(lambda member: (get_name(member), member), members)
return (details, members, mlist.owner)
@@
-879,14
+885,18
@@
def create_list(userdesc, perms, vhost, listname, desc, advertise, modlevel, ins
"""
name = vhost.lower() + VHOST_SEP + listname.lower();
if Utils.list_exists(name):
"""
name = vhost.lower() + VHOST_SEP + listname.lower();
if Utils.list_exists(name):
+ print >> sys.stderr, "List ", name, " already exists"
return 0
owner = []
for o in owners:
return 0
owner = []
for o in owners:
- email = to_forlife(o)[0]
+ email = to_forlife(o)
+ print >> sys.stderr, "owner in list", o, email
+ email = email[0]
if email is not None:
owner.append(email)
if len(owner) is 0:
if email is not None:
owner.append(email)
if len(owner) is 0:
+ print >> sys.stderr, "No owner found in ", owners
return 0
mlist = MailList.MailList()
return 0
mlist = MailList.MailList()