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

Commitdde01c7

Browse files
authored
Merge pull request#1415 from JohnVillalovos/jlvillal/list_attribute_int
feat: add support for lists of integers to ListAttribute
2 parents5b81d7d +115938b commitdde01c7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

‎gitlab/tests/test_types.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def test_list_attribute_get_for_api_from_list():
5959
asserto.get_for_api()=="foo,bar,baz"
6060

6161

62+
deftest_list_attribute_get_for_api_from_int_list():
63+
o=types.ListAttribute([1,9,7])
64+
asserto.get_for_api()=="1,9,7"
65+
66+
6267
deftest_list_attribute_does_not_split_string():
6368
o=types.ListAttribute("foo")
6469
asserto.get_for_api()=="foo"

‎gitlab/types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_for_api(self):
4242
ifisinstance(self._value,str):
4343
returnself._value
4444

45-
return",".join(self._value)
45+
return",".join([str(x)forxinself._value])
4646

4747

4848
classLowercaseStringAttribute(GitlabAttribute):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp