Skip to content

Commit

Permalink
fix: Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
snaselj committed Feb 19, 2024
1 parent 430779f commit 87b6634
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pylint_nautobot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ def get_model_name_from_queryset(node: NodeNG) -> str:
elif isinstance(node, Attribute):
if node.attrname == "objects":
if isinstance(node.expr, Name):
# Covers `queryset = AddressObject.objects.all()`
return node.expr.name
if isinstance(node.expr, Attribute):
# Covers `queryset = models.AddressObject.objects.all()`
return node.expr.attrname
node = node.expr
else:
Expand Down

0 comments on commit 87b6634

Please sign in to comment.