Skip to content

Commit 888f332

Browse files
fix(api): services: add missing lazy parameter
Commit 8da0b75 added the `lazy` parameter to the services `get()` method but missed then using the `lazy` parameter when it called `super(...).get(...)` Closes: #1828
1 parent 4a000b6 commit 888f332

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

gitlab/v4/objects/services.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
GitLab API:
3+
https://docs.gitlab.com/ee/api/integrations.html
4+
"""
5+
16
from typing import Any, cast, Dict, List, Optional, Union
27

38
from gitlab import cli
@@ -275,7 +280,10 @@ def get(
275280
GitlabAuthenticationError: If authentication is not correct
276281
GitlabGetError: If the server cannot perform the request
277282
"""
278-
obj = cast(ProjectService, super(ProjectServiceManager, self).get(id, **kwargs))
283+
obj = cast(
284+
ProjectService,
285+
super(ProjectServiceManager, self).get(id, lazy=lazy, **kwargs),
286+
)
279287
obj.id = id
280288
return obj
281289

tests/functional/api/test_services.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""
2+
GitLab API:
3+
https://docs.gitlab.com/ee/api/integrations.html
4+
"""
5+
6+
import gitlab
7+
8+
9+
def test_services(project):
10+
service = project.services.get("jira", lazy=True)
11+
assert isinstance(service, gitlab.v4.objects.ProjectService)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy