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

« back to all changes in this revision

Viewing changes to lib/common/db.py

  • Committer: mattgiuca
  • Date: 2008-02-25 05:16:32 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:575
common/usr, common/db: Added field to User, "local_password",
    a boolean which is True if the user has a local password.
    db getuser puts this into the user.

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
        "rolenm", "studentid", "acct_exp", "pass_exp", "last_login", "svn_pass"
290
290
    ]
291
291
    login_fields = frozenset(login_fields_list)
292
 
    # Do not return passhash when reading from the DB
293
 
    login_getfields = login_fields - frozenset(["passhash"])
294
292
 
295
293
    def create_user(self, user_obj=None, dry=False, **kwargs):
296
294
        """Creates a user login entry in the database.
365
363
        Raises a DBException if the login is not found in the DB.
366
364
        """
367
365
        userdict = self.get_single({"login": login}, "login",
368
 
            self.login_getfields, self.login_primary,
 
366
            self.login_fields, self.login_primary,
369
367
            error_notfound="get_user: No user with that login name", dry=dry)
370
368
        if dry:
371
369
            return userdict     # Query string
375
373
    def get_users(self, dry=False):
376
374
        """Returns a list of all users in the DB, as User objects.
377
375
        """
378
 
        userdicts = self.get_all("login", self.login_getfields, dry=dry)
 
376
        userdicts = self.get_all("login", self.login_fields, dry=dry)
379
377
        if dry:
380
378
            return userdicts    # Query string
381
379
        # Package into User objects