Skip to content

Commit

Permalink
ignoring the list return vs the typical dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
bandophahita committed Jun 12, 2024
1 parent 3639db7 commit 13161bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -3401,17 +3401,17 @@ def get_all_available_screen_fields(self, screen_id: T_id) -> T_resp_json:
url = "{base_url}/{screen_id}/availableFields".format(base_url=base_url, screen_id=screen_id)
return self.get(url)

def get_screen_tabs(self, screen_id: T_id) -> list:
def get_screen_tabs(self, screen_id: T_id) -> Optional[list]:
"""
Get tabs for the screen id
:param screen_id:
:return:
"""
base_url = self.resource_url("screens")
url = "{base_url}/{screen_id}/tabs".format(base_url=base_url, screen_id=screen_id)
return self.get(url)
return self.get(url) # type: ignore[return-value]

def get_screen_tab_fields(self, screen_id: T_id, tab_id: T_id) -> list:
def get_screen_tab_fields(self, screen_id: T_id, tab_id: T_id) -> Optional[list]:
"""
Get fields by the tab id and the screen id
:param tab_id:
Expand All @@ -3422,20 +3422,20 @@ def get_screen_tab_fields(self, screen_id: T_id, tab_id: T_id) -> list:
url = "{base_url}/{screen_id}/tabs/{tab_id}/fields".format(
base_url=base_url, screen_id=screen_id, tab_id=tab_id
)
return self.get(url)
return self.get(url) # type: ignore[return-value]

def get_all_screen_fields(self, screen_id: T_id) -> list:
"""
Get all fields by screen id
:param screen_id:
:return:
"""
screen_tabs = self.get_screen_tabs(screen_id)
screen_tabs = self.get_screen_tabs(screen_id) or []
fields: list = []
for screen_tab in screen_tabs:
tab_id = screen_tab["id"]
if tab_id:
tab_fields = self.get_screen_tab_fields(screen_id=screen_id, tab_id=tab_id)
tab_fields = self.get_screen_tab_fields(screen_id=screen_id, tab_id=tab_id) or []
fields = fields + tab_fields
return fields

Expand Down

0 comments on commit 13161bb

Please sign in to comment.