Skip to content

Commit

Permalink
Fix issue #574
Browse files Browse the repository at this point in the history
  • Loading branch information
ehooo authored and ericwb committed Apr 16, 2020
1 parent 8127716 commit bbe99a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bandit/plugins/django_xss.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def is_assigned(self, node):
assigned = self.is_assigned_in(node.body)
else:
for withitem in node.items:
if withitem.optional_vars.id == self.var_name.id:
var_id = getattr(withitem.optional_vars, 'id', None)
if var_id == self.var_name.id:
assigned = node
else:
assigned = self.is_assigned_in(node.body)
Expand Down

0 comments on commit bbe99a8

Please sign in to comment.