Skip to content

Commit c528bb3

Browse files
committed
fixed bug with create team/org
1 parent 4fc51c2 commit c528bb3

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,12 @@ from gremlinapi.config import GremlinAPIConfig as config
8787
from gremlinapi.orgs import GremlinAPIOrgs as orgs
8888
config.bearer_token = 'Bearer MU3...ZiTk...Lo...4zO..c='
8989
orgs.list_orgs()
90+
```
91+
92+
#### Create a team
93+
```python
94+
from gremlinapi.config import GremlinAPIConfig as config
95+
from gremlinapi.orgs import GremlinAPIOrgs as orgs
96+
config.bearer_token = 'Bearer MU3...ZiTk...Lo...4zO..c='
97+
9098
```

gremlinapi/orgs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ def get_org(cls, https_client=get_gremlin_httpclient(), *args, **kwargs):
4242
return body
4343

4444
@classmethod
45-
@register_cli_action('create_org', ('body',), ('',))
45+
@register_cli_action('create_org', ('name',), ('',))
4646
def create_org(cls, https_client=get_gremlin_httpclient(), *args, **kwargs):
4747
method = 'POST'
4848
endpoint = '/orgs'
49-
data = cls._error_if_not_json_body(**kwargs)
50-
payload = cls._payload(**{'headers': https_client.header(), 'body': data})
49+
data = {
50+
'name': cls._error_if_not_param('name', **kwargs)
51+
}
52+
payload = cls._payload(**{'headers': https_client.header(), 'data': data})
5153
(resp, body) = https_client.api_call(method, endpoint, **payload)
5254
return body
5355

0 commit comments

Comments
 (0)