Skip to content

Commit

Permalink
Fixed Nerd02 skill issue
Browse files Browse the repository at this point in the history
  • Loading branch information
isFakeAccount committed Dec 22, 2023
1 parent b198cbf commit 6b07009
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
passwords.py
async_lemmy_test.py
creds.json
__pycache__
venv
*.json
*.ipynb
.idea
.env
.idea
.mypy_cache
.ruff_cache
.vscode
*.ipynb
*.json
async_lemmy_test.py
creds.json
dataBased.json
logs/
passwords.py
venv
4 changes: 4 additions & 0 deletions async_lemmy_py/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ async def get_flair(self) -> Optional[UserFlair]:
if resp.status == 404:
return None
data = await resp.json()

# Nerd02 skill issue. If a user doesn't have a flair it should ideally return resp.status == 404. But instead it returns None.
if data is None:
return None
return UserFlair(**data)

0 comments on commit 6b07009

Please sign in to comment.