Language: Python
Label: vulnerable
CWE: CWE-209 \u2014 Generation of Error Message Containing Sensitive Information
The product generates an error message that includes sensitive information about its environment, users, or associated data.

Code:
    def get_keys(self, lst):
        """
            return a list of pk values from object list
        """
        pk_name = self.get_pk_name()
        if self.is_pk_composite():
            return [[getattr(item, pk) for pk in pk_name] for item in lst]
        else:
            return [getattr(item, pk_name) for item in lst]