def hash_user_password(user):
 password = user.get('password')
 if (password is None):
  return user
 return dict(user, password=hash_password(password))

def hash_user_password ( user ) : password = user . get ( 'password' ) if ( password is None ) : return user return dict ( user , password = hash_password ( password ) )
hash a user dicts password without modifying the passed-in dict .