Skip to content

Commit

Permalink
added default_lists as parameter to add_board
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Sefan Cassola committed Jun 5, 2018
1 parent 7e9acf2 commit 758d133
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions trello/trelloclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# It is not a hard requirement, so it's not listed in requirements.txt
# More info https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
import urllib3.contrib.pyopenssl

urllib3.contrib.pyopenssl.inject_into_urllib3()
except:
pass
Expand Down Expand Up @@ -122,7 +123,8 @@ def get_board(self, board_id):
obj = self.fetch_json('/boards/' + board_id)
return Board.from_json(self, json_obj=obj)

def add_board(self, board_name, source_board=None, organization_id=None, permission_level='private'):
def add_board(self, board_name, source_board=None, organization_id=None, permission_level='private',
default_lists=True):
"""Create board
:param board_name: Name of the board to create
:param source_board: Optional Board to copy
Expand All @@ -134,6 +136,8 @@ def add_board(self, board_name, source_board=None, organization_id=None, permiss
post_args['idBoardSource'] = source_board.id
if organization_id is not None:
post_args['idOrganization'] = organization_id
if not default_lists:
post_args['defaultLists'] = False

obj = self.fetch_json('/boards', http_method='POST',
post_args=post_args)
Expand Down Expand Up @@ -216,8 +220,8 @@ def fetch_json(

# perform the HTTP requests, if possible uses OAuth authentication
response = self.http_service.request(http_method, url, params=query_params,
headers=headers, data=data,
auth=self.oauth, files=files)
headers=headers, data=data,
auth=self.oauth, files=files)

if response.status_code == 401:
raise Unauthorized("%s at %s" % (response.text, url), response)
Expand Down Expand Up @@ -371,7 +375,7 @@ def list_stars(self):
json_obj = self.fetch_json('/members/me/boardStars')
return [Star.from_json(json_obj=obj) for obj in json_obj]

def add_star(self, board_id, position = "bottom"):
def add_star(self, board_id, position="bottom"):
"""Create a star
:param board_iid: Id of the board to star
:param position: Optional position of the board star
Expand Down

0 comments on commit 758d133

Please sign in to comment.