diff options
author | John L. Villalovos <john@sodarock.com> | 2021-03-07 15:17:33 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-03-07 15:17:33 -0800 |
commit | 8224b4066e84720d7efed3b7891c47af73cc57ca (patch) | |
tree | 9b5d08c0d85bd177ce94ffec7c2a2fef8d22ea45 /gitlab/base.py | |
parent | de73ea7933d3f3c94aa27a7d9b9ea7bfd64ad1f1 (diff) | |
download | gitlab-8224b4066e84720d7efed3b7891c47af73cc57ca.tar.gz |
fix: checking if RESTManager._from_parent_attrs is set
Prior to commit 3727cbd21fc40b312573ca8da56e0f6cf9577d08
RESTManager._from_parent_attrs did not exist unless it was explicitly
set. But commit 3727cbd21fc40b312573ca8da56e0f6cf9577d08 set it to a
default value of {}.
So the checks using hasattr() were no longer valid.
Update the checks to check if RESTManager._from_parent_attrs has a
value.
Diffstat (limited to 'gitlab/base.py')
-rw-r--r-- | gitlab/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/base.py b/gitlab/base.py index b9960ad..62ace95 100644 --- a/gitlab/base.py +++ b/gitlab/base.py @@ -290,12 +290,12 @@ class RESTManager(object): path = self._path if path is None: return None - if self._parent is None or not hasattr(self, "_from_parent_attrs"): + if self._parent is None or not self._from_parent_attrs: return path data = { self_attr: getattr(self._parent, parent_attr, None) - for self_attr, parent_attr in self._from_parent_attrs.items() # type: ignore + for self_attr, parent_attr in self._from_parent_attrs.items() } self._parent_attrs = data return path % data |