Skip to content

Commit

Permalink
Minor code readability fix for Gitlab
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Nov 2, 2023
1 parent f4fa40f commit 4f6a03e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions services/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ def get_assigned(
user = self.client.users.list(username=username)[0] # type: ignore
else:
user = self.client.user
filters["assignee_id"] = user.id
if pull_requests:
issues = list(
self.client.mergerequests.list(assignee_id=user.id, **filters)
)
issues = list(self.client.mergerequests.list(**filters))
else:
issues = list(self.client.issues.list(assignee_id=user.id, **filters))
issues = list(self.client.issues.list(**filters))
except (GitlabError, RequestException) as exc:
logging.error("Gitlab: %s: get_assigned(%s): %s", self.url, username, exc)
return [self._to_issue(issue) for issue in issues]
Expand All @@ -98,10 +97,11 @@ def get_created(
user = self.client.users.list(username=username)[0] # type: ignore
else:
user = self.client.user
filters["author"] = user.id
if pull_requests:
issues = list(self.client.mergerequests.list(author=user.id, **filters))
issues = list(self.client.mergerequests.list(**filters))
else:
issues = list(self.client.issues.list(author=user.id, **filters))
issues = list(self.client.issues.list(**filters))
except (GitlabError, RequestException) as exc:
logging.error("Gitlab: %s: get_created(%s): %s", self.url, username, exc)
return [self._to_issue(issue) for issue in issues]
Expand Down

0 comments on commit 4f6a03e

Please sign in to comment.