Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2cbd674

Browse files
ptalbertnejch
authored andcommitted
fix(api): use ID instead of name for GroupLabel & ProjectLabel _id_attr
_id_attr is used when comparing RESTObject objects. Labels will be seenas equal when they have the same name even if they are from differentgroups or projects.Instead, use the label's ID as the _id_attr so that comparisions willonly be equal if they truly represent the same gitlab label object.Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
1 parentc378817 commit2cbd674

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎gitlab/v4/objects/labels.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323

2424

2525
classGroupLabel(SubscribableMixin,SaveMixin,ObjectDeleteMixin,RESTObject):
26-
_id_attr="name"
26+
_id_attr="id"
27+
_repr_attr="name"
2728
manager:"GroupLabelManager"
2829

2930
# Update without ID, but we need an ID to get from list.
@@ -87,7 +88,8 @@ def update( # type: ignore
8788
classProjectLabel(
8889
PromoteMixin,SubscribableMixin,SaveMixin,ObjectDeleteMixin,RESTObject
8990
):
90-
_id_attr="name"
91+
_id_attr="id"
92+
_repr_attr="name"
9193
manager:"ProjectLabelManager"
9294

9395
# Update without ID, but we need an ID to get from list.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp