diff options
| author | bwarsaw | 2002-11-18 16:19:33 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-11-18 16:19:33 +0000 |
| commit | 87e2d887f881038d45e1bc52e9468fd536188f2e (patch) | |
| tree | 165197e37d1a20e0e4dfd6554d84ed7082ac2b8d /Mailman/Cgi/admin.py | |
| parent | 6e511d675c8b7442f5b9786c46bcba6d756c4153 (diff) | |
| download | mailman-87e2d887f881038d45e1bc52e9468fd536188f2e.tar.gz mailman-87e2d887f881038d45e1bc52e9468fd536188f2e.tar.zst mailman-87e2d887f881038d45e1bc52e9468fd536188f2e.zip | |
Diffstat (limited to 'Mailman/Cgi/admin.py')
| -rw-r--r-- | Mailman/Cgi/admin.py | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 4bf3e269c..4bb80e0b8 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -824,34 +824,36 @@ def membership_options(mlist, subcat, cgidata, doc, form): bucket = 'a' # POST methods, even if their actions have a query string, don't get # put into FieldStorage's keys :-( - qs = cgi.parse_qs(os.environ['QUERY_STRING']) - 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) + 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) # So now members holds all the addresses we're going to display allcnt = len(all) if bucket: |
