summaryrefslogtreecommitdiff
path: root/gitlab/mixins.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2021-11-30 08:35:58 -0800
committerJohn L. Villalovos <john@sodarock.com>2021-11-30 08:35:58 -0800
commit1839c9e7989163a5cc9a201241942b7faca6e214 (patch)
treef6fcb4f19fb62e6db8234a6f96d367ec093cab27 /gitlab/mixins.py
parent09a973ee379d82af05a5080decfaec16d2f4eab3 (diff)
downloadgitlab-jlvillal/attribute_help.tar.gz
chore: attempt to be more informative for missing attributesjlvillal/attribute_help
A commonly reported issue from users on Gitter is that they get an AttributeError for an attribute that should be present. This is often caused due to the fact that they used the `list()` method to retrieve the object and objects retrieved this way often only have a subset of the full data. Add more details in the AttributeError message that explains the situation to users. This will hopefully allow them to resolve the issue. Update the FAQ in the docs to add a section discussing the issue. Closes #1138
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r--gitlab/mixins.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py
index 0159ecd..ed3dbdc 100644
--- a/gitlab/mixins.py
+++ b/gitlab/mixins.py
@@ -240,7 +240,7 @@ class ListMixin(_RestManagerBase):
assert self._obj_cls is not None
obj = self.gitlab.http_list(path, **data)
if isinstance(obj, list):
- return [self._obj_cls(self, item) for item in obj]
+ return [self._obj_cls(self, item, created_from_list=True) for item in obj]
else:
return base.RESTObjectList(self, self._obj_cls, obj)