Ignore:
Timestamp:
Dec 1, 2017, 11:38:50 AM (2 years ago)
Author:
mabarracus
Message:

Fix type checks with unicode vars

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hwdetector/trunk/fuentes/hwdetector.install/hwdetector/modules/llxusers.py

    r6399 r6420  
    113113        try:
    114114            people=LDAP_INFO['CONFIG']['DB']['net']['lliurex']['ma5']['People']
    115             users=[(x,people['Students'][x]) for x in people['Students'].keys() if type(people['Students'][x]) == type(dict())]
    116             admins=[(x,people['Admins'][x]) for x in people['Admins'].keys() if type(people['Admins'][x]) == type(dict())]
    117             teachers=[(x,people['Teachers'][x]) for x in people['Teachers'].keys() if type(people['Teachers'][x]) == type(dict())]
     115            users=[(x,people['Students'][x]) for x in people['Students'].keys() if isinstance(people['Students'][x],dict)]
     116            admins=[(x,people['Admins'][x]) for x in people['Admins'].keys() if isinstance(people['Admins'][x],dict)]
     117            teachers=[(x,people['Teachers'][x]) for x in people['Teachers'].keys() if isinstance(people['Teachers'][x],dict)]
    118118        except Exception as e:
    119119            log.warning('Fail getting needed ldap information, using fake information only for current user')
Note: See TracChangeset for help on using the changeset viewer.