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

« back to all changes in this revision

Viewing changes to www/apps/userservice/__init__.py

  • Committer: me at id
  • Date: 2009-02-02 03:29:40 UTC
  • Revision ID: svn-v4:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1186
www/apps/userservice#get_user: Set local_password in the output dict to True
    if there is a passhash, and False otherwise. Fixes the password inputs
    not appearing on /settings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
411
411
        login = req.user.login
412
412
 
413
413
    # Just talk direct to the DB
414
 
    user = ivle.database.User.get_by_login(req.store, login)
415
 
    user = ivle.util.object_to_dict(user_fields_list, user)
 
414
    userobj = ivle.database.User.get_by_login(req.store, login)
 
415
    user = ivle.util.object_to_dict(user_fields_list, userobj)
416
416
    # Convert time stamps to nice strings
417
417
    for k in 'pass_exp', 'acct_exp', 'last_login':
418
418
        if user[k] is not None:
419
419
            user[k] = unicode(user[k])
420
420
 
 
421
    user['local_password'] = userobj.passhash is not None
 
422
 
421
423
    response = cjson.encode(user)
422
424
    req.content_type = "text/plain"
423
425
    req.write(response)