Skip to content

Commit

Permalink
stats: Ignore invalid attributes
Browse files Browse the repository at this point in the history
This makes it easier to debug invalid stats usage.
  • Loading branch information
nijel committed Sep 19, 2023
1 parent 3d2ad75 commit 54193a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion weblate/utils/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ def has_review(self):
def cache_key(self):
return f"stats-{self._object.cache_key}"

def __getattr__(self, name):
def __getattr__(self, name: str):
if name.startswith("_"):
raise AttributeError
if self._data is None:
self._data = self.load()
if name.endswith("_percent"):
Expand Down

0 comments on commit 54193a4

Please sign in to comment.