Skip to content

Commit

Permalink
fix: Prevent Periodical from being accessed by Django Debug Toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonee committed Oct 4, 2024
1 parent 645208b commit b6d388a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/apps/tree/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ def __len__(self):
return len(self.plans)

def __getattr__(self, attr):
if attr == '_wrapped':
raise AttributeError

attr1, attr2 = attr.split('__')

return map(lambda x: getattr(x, attr2), getattr(self, attr1 + 's'))
Expand Down

0 comments on commit b6d388a

Please sign in to comment.