Skip to content

Commit

Permalink
🐛 Fixed bug when 'fiscal_responsavel' is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldokun committed Jul 14, 2024
1 parent d3ee7c3 commit 5885cca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fiscaliza/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def extract_string(field: str) -> str | list:
return fields[0]
return fields
else:
return str(field)
return ""

@property
def type(self) -> str:
Expand Down Expand Up @@ -257,9 +257,8 @@ def attrs(self) -> dict:
attrs["ACAO"] = self._extract_acao()
attrs["ATUALIZACAO"] = self.update_on()
attrs["MEMBROS"] = list(self._issue_members().values())
attrs["fiscal_responsavel"] = self.ids2names().get(
int(attrs.get("fiscal_responsavel")), ""
)
if fiscal := attrs.get("fiscal_responsavel"):
attrs["fiscal_responsavel"] = self.ids2names().get(int(fiscal), "")
attrs["fiscais"] = [
self.ids2names().get(int(f), "") for f in listify(attrs.get("fiscais", []))
]
Expand Down

0 comments on commit 5885cca

Please sign in to comment.