~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to lib/common/db.py

  • Committer: drtomc
  • Date: 2008-02-25 20:53:26 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:585
db: remove local_password before trying to create accounts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        Raises a DBException if the dictionary contains invalid fields.
141
141
        """
142
142
        if not DB.check_dict(dict, tablefields, disallowed):
143
 
            raise DBException("Supplied dictionary contains invalid fields.")
 
143
            extras = set(dict.keys()) - tablefields
 
144
            raise DBException("Supplied dictionary contains invalid fields. (%s)" % (repr(extras)))
144
145
        # Build two lists concurrently: field names and values, as SQL strings
145
146
        fieldnames = []
146
147
        values = []
329
330
            # else, we'll trust the user, but it SHOULD be "no_agreement"
330
331
            # (We can't change it because then the user object would not
331
332
            # reflect the DB).
 
333
        if 'local_password' in fields:
 
334
            del fields['local_password']
332
335
        # Execute the query.
333
336
        return self.insert(fields, "login", self.login_fields, dry=dry)
334
337