~alecu/ubuntu-sso-client/changed-secrets-spec

« back to all changes in this revision

Viewing changes to ubuntu_sso/keyring/windows.py

  • Committer: Tarmac
  • Author(s): Manuel de la Pena
  • Date: 2011-04-01 08:31:29 UTC
  • mfrom: (692.2.2 fix_no_creds_windows)
  • Revision ID: tarmac-20110401083129-hdthiwxmskxfyt0n
Fixes lp:746096 the bug by ensuring that we do not try to load a json object from None. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    def _get_credentials_obj(self, app_name):
45
45
        """A dict with the credentials."""
46
46
        creds = self.keyring.get_password(app_name, USERNAME)
47
 
        return loads(creds)
 
47
        if creds:
 
48
            return loads(creds)
48
49
 
49
50
    def get_credentials(self, app_name):
50
51
        """A deferred with the secret of the SSO item in a dictionary."""