r22890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22889‎ | r22890 | r22891 >
Date:20:24, 10 June 2007
Author:Mark Bergsma
Status:old
Tags:
Comment:
Fix several bugs
Modified paths:
  • /trunk/wmfmailadmin/wmfmailadmin.py (modified) (history)

Diff [purge]

Index: trunk/wmfmailadmin/wmfmailadmin.py
@@ -7,7 +7,7 @@
88
99 import sys, os, sqlite3
1010
11 -dbname = '/var/vmail/user.db'
 11+dbname = '/var/vmaildb/user.db'
1212 conn = None
1313
1414 actions = {
@@ -84,7 +84,7 @@
8585 require_fields( (required_fields, ), fields)
8686
8787 # Set default values for fields not given
88 - value_fields = ['localpart', 'domain', 'realname', 'filter']
 88+ value_fields = ['localpart', 'domain', 'realname', 'password', 'active', 'filter']
8989 for fieldname in updateables:
9090 default = longmappings[fieldname][2]
9191 if fieldname not in fields:
@@ -94,7 +94,7 @@
9595 value_fields.append(fieldname)
9696 else:
9797 # Field is not given on the command line, and apparently not required
98 - value_fields.remote(fieldname)
 98+ value_fields.remove(fieldname)
9999
100100 # Input password if needed
101101 input_password(fields)
@@ -229,7 +229,7 @@
230230
231231 global max_filter_size
232232
233 - if fields['filter'] == "": return
 233+ if not fields.has_key('filter') or fields['filter'] == "": return
234234
235235 if fields['filter'] == '-':
236236 filterfile = sys.stdin
@@ -389,7 +389,7 @@
390390 elif action == 'show':
391391 show_field(fields)
392392 except sqlite3.IntegrityError, e:
393 - print >> sys.stderr, "SQL integrity error. Account does already exist? (%s)" % e.message
 393+ print >> sys.stderr, "SQL integrity error. Maybe the account does already exist? (%s)" % e.message
394394 sys.exit(2)
395395 except Exception, e:
396396 print >> sys.stderr, "Error:", e.message

Status & tagging log