Skip to content

Commit

Permalink
feat: Add current_user property
Browse files Browse the repository at this point in the history
This change adds a new `current_user` property to the `Issue` class that retrieves the full name of the current user from the client's user data.
  • Loading branch information
ronaldokun committed Aug 9, 2024
1 parent ba66d70 commit 58721ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fiscaliza/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def __init__(self, client: Redmine, issue_id: int | str):
)
self._ascii2utf = {}

@property
def current_user(self):
user = dict(list(self.client.user.get("current")))
return f'{user.get("firstname", "")} {user.get("lastname", "")}'

@staticmethod
def __format_json_string(field: str) -> str:
"""Recebe uma string formatada como json e retorna a mesma string formatada como json"""
Expand Down

0 comments on commit 58721ef

Please sign in to comment.