Skip to content

Commit

Permalink
Merge pull request #1410 from JohnVillalovos/jlvillal/short_print_attr
Browse files Browse the repository at this point in the history
chore: make RESTObject._short_print_attrs always present
  • Loading branch information
max-wittig committed Apr 25, 2021
2 parents 0a0fcaf + 6d55120 commit 09522b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions gitlab/base.py
Expand Up @@ -45,6 +45,7 @@ class RESTObject(object):
_attrs: Dict[str, Any]
_module: ModuleType
_parent_attrs: Dict[str, Any]
_short_print_attr: Optional[str] = None
_updated_attrs: Dict[str, Any]
manager: "RESTManager"

Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/cli.py
Expand Up @@ -380,7 +380,7 @@ def display_dict(d, padding):
if obj._id_attr:
id = getattr(obj, obj._id_attr)
print("%s: %s" % (obj._id_attr.replace("_", "-"), id))
if hasattr(obj, "_short_print_attr"):
if obj._short_print_attr:
value = getattr(obj, obj._short_print_attr) or "None"
value = value.replace("\r", "").replace("\n", " ")
# If the attribute is a note (ProjectCommitComment) then we do
Expand Down

0 comments on commit 09522b3

Please sign in to comment.