Revision ea05c568 snf-astakos-app/astakos/im/models.py

b/snf-astakos-app/astakos/im/models.py
314 314
        Returns a username to uuid mapping for the usernames appearing in l.
315 315
        If l is None returns the mapping for all existing users.
316 316
        """
317
        q = self.filter(uuid__in=l) if l != None else self
318
        q = self.filter(username__in=l) if l != None else self
319
        return dict(q.values_list('username', 'uuid'))
317
        if l is not None:
318
            lmap = dict((x.lower(), x) for x in l)
319
            q = self.filter(username__in=lmap.keys())
320
            values = ((lmap[n], u) for n, u in q.values_list('username', 'uuid'))
321
        else:
322
            q = self
323
            values = self.values_list('username', 'uuid')
324
        return dict(values)
320 325

  
321 326

  
322 327

  

Also available in: Unified diff