r23160 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23159‎ | r23160 | r23161 >
Date:13:10, 21 June 2007
Author:Mark Bergsma
Status:old
Tags:
Comment:
Support removing user filters by setting NULL in the db
Modified paths:
  • /trunk/wmfmailadmin/wmfmailadmin.py (modified) (history)

Diff [purge]

Index: trunk/wmfmailadmin/wmfmailadmin.py
@@ -28,7 +28,7 @@
2929 'i': ('id', "Id", None, None),
3030 'q': ('quota', "Quota", 2**30/1024, None),
3131 'a': ('active', "Active", True, None),
32 - 'f': ('filter', "Filter", None, "Filter file or '-' for stdin")
 32+ 'f': ('filter', "Filter", None, "Filter file or '-' for stdin, or 'None'")
3333 }
3434 longmappings = {}
3535
@@ -231,7 +231,11 @@
232232
233233 if not fields.has_key('filter') or fields['filter'] == "": return
234234
235 - if fields['filter'] == '-':
 235+ if fields['filter'].lower() == 'none':
 236+ # Set to NULL in the db
 237+ fields['filter'] = None
 238+ return
 239+ elif fields['filter'] == '-':
236240 filterfile = sys.stdin
237241 else:
238242 try:

Status & tagging log