Get attribute for user

def get_attribute(self, code, default=None):
        """Get attribute for user"""
        try:
            return self.get(code=code).value
        except models.ObjectDoesNotExist:
            return default