Skip to content

Commit a8f4c23

Browse files
chore: remove usage of getattr()
Remove usage of getattr(self, "_update_uses_post", False) Instead add it to class and set default value to False.
1 parent 8ace76a commit a8f4c23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gitlab/mixins.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ class UpdateMixin(_RestManagerBase):
331331
_parent = Optional[base.RESTObject]
332332
_parent_attrs = Dict[str, Any]
333333
_path: Optional[str]
334+
_update_uses_post: bool = False
334335
gitlab: gitlab.Gitlab
335336

336337
def _check_missing_update_attrs(self, data: Dict[str, Any]) -> None:
@@ -357,7 +358,7 @@ def _get_update_method(
357358
Returns:
358359
object: http_put (default) or http_post
359360
"""
360-
if getattr(self, "_update_uses_post", False):
361+
if self._update_uses_post:
361362
http_method = self.gitlab.http_post
362363
else:
363364
http_method = self.gitlab.http_put

0 commit comments

Comments
 (0)