diff options
| author | bwarsaw | 2002-12-09 05:58:26 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-12-09 05:58:26 +0000 |
| commit | 769d63249ae1d6d3f49e4c831da54932290b4980 (patch) | |
| tree | df38c3b3cbcc2c413a94db857c19db67dc983cdb /Mailman/Cgi/admin.py | |
| parent | 3d0c7769c786ce657c0325d30d695aebe6a66269 (diff) | |
| download | mailman-769d63249ae1d6d3f49e4c831da54932290b4980.tar.gz mailman-769d63249ae1d6d3f49e4c831da54932290b4980.tar.zst mailman-769d63249ae1d6d3f49e4c831da54932290b4980.zip | |
Diffstat (limited to 'Mailman/Cgi/admin.py')
| -rw-r--r-- | Mailman/Cgi/admin.py | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index a85ed9295..331a83b07 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -821,39 +821,39 @@ def membership_options(mlist, subcat, cgidata, doc, form): members = buckets.setdefault(addr[0].lower(), []) members.append(addr) # Now figure out which bucket we want - bucket = 'a' + bucket = None + qs = {} # POST methods, even if their actions have a query string, don't get # put into FieldStorage's keys :-( qsenviron = os.environ.get('QUERY_STRING') if qsenviron: qs = cgi.parse_qs(qsenviron) - if qs.has_key('letter'): - bucket = qs['letter'][0].lower() - if bucket not in digits + lowercase: - bucket = None - if not bucket or not buckets.has_key(bucket): - keys = buckets.keys() - keys.sort() - bucket = keys[0] - members = buckets[bucket] - action = adminurl + '/members?letter=%s' % bucket - if len(members) <= chunksz: - form.set_action(action) - else: - i, r = divmod(len(members), chunksz) - numchunks = i + (not not r * 1) - # Now chunk them up - chunkindex = 0 - if qs.has_key('chunk'): - try: - chunkindex = int(qs['chunk'][0]) - except ValueError: - chunkindex = 0 - if chunkindex < 0 or chunkindex > numchunks: - chunkindex = 0 - members = members[chunkindex*chunksz:(chunkindex+1)*chunksz] - # And set the action URL - form.set_action(action + '&chunk=%s' % chunkindex) + bucket = qs.get('letter', 'a')[0].lower() + if bucket not in digits + lowercase: + bucket = None + if not bucket or not buckets.has_key(bucket): + keys = buckets.keys() + keys.sort() + bucket = keys[0] + members = buckets[bucket] + action = adminurl + '/members?letter=%s' % bucket + if len(members) <= chunksz: + form.set_action(action) + else: + i, r = divmod(len(members), chunksz) + numchunks = i + (not not r * 1) + # Now chunk them up + chunkindex = 0 + if qs.has_key('chunk'): + try: + chunkindex = int(qs['chunk'][0]) + except ValueError: + chunkindex = 0 + if chunkindex < 0 or chunkindex > numchunks: + chunkindex = 0 + members = members[chunkindex*chunksz:(chunkindex+1)*chunksz] + # And set the action URL + form.set_action(action + '&chunk=%s' % chunkindex) # So now members holds all the addresses we're going to display allcnt = len(all) if bucket: @@ -1241,7 +1241,10 @@ def change_options(mlist, category, subcat, cgidata, doc): digest = 1 subscribe_errors = [] subscribe_success = [] - # Now cruise through all the subscribees and do the deed + # Now cruise through all the subscribees and do the deed. BAW: we + # should limit the number of "Successfully subscribed" status messages + # we display. Try uploading a file with 10k names -- it takes a while + # to render the status page. for entry in entries: fullname, address = parseaddr(entry) # Canonicalize the full name |
