Skip to content

Commit

Permalink
Placate mypy
Browse files Browse the repository at this point in the history
Not sure why it can't see these attributes; they're definitely present.
  • Loading branch information
PeterJCLaw committed Sep 16, 2023
1 parent 68e467e commit 7c9db62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpdesk/helpdesk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

def get_object_or_none(model: type[ModelT], **kwargs: Any) -> ModelT | None:
try:
return model.objects.get(**kwargs)
except model.DoesNotExist:
return model.objects.get(**kwargs) # type: ignore[attr-defined]
except model.DoesNotExist: # type: ignore[attr-defined]
return None

0 comments on commit 7c9db62

Please sign in to comment.