Changeset 5874


Ignore:
Timestamp:
23/10/09 15:43:29 (10 years ago)
Author:
pjkersha
Message:

Fix for no matching userkey result for generateFromUserKey method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg_security_common_utils_openid_dbinterface/ndg/security/common/utils/openid/dbinterface.py

    r5872 r5874  
    375375        @param userKey: database user table primary key 
    376376        @rtype: string 
    377         @return: OpenID user identifier 
     377        @return: OpenID user identifier, None if user key is not found 
    378378        """ 
    379379        queryTmpl = Template(self.__generateFromUserKeyQuery) 
     
    391391            self.close() 
    392392 
     393        if len(queryRes) == 0: 
     394            log.debug("No userkey = %r found", userKey) 
     395            return None 
     396         
    393397        # Create OpenID URL snippet 
    394398        res = queryRes[0] 
     
    514518 
    515519            identifier = ids.generateFromUserKey(opt.userKey) 
    516             print(identifier) 
     520            if identifier is None: 
     521                print() 
     522            else: 
     523                print(identifier) 
    517524 
    518525        elif opt.command == cls.QUERY_IDENTIFIER_CMD_STR: 
Note: See TracChangeset for help on using the changeset viewer.