diff options
| author | bkonkle | 2011-09-15 10:09:53 -0500 | 
|---|---|---|
| committer | bkonkle | 2011-09-15 10:09:53 -0500 | 
| commit | c20e83fc946c8898d40b0210f71286575891ae94 (patch) | |
| tree | cf19f6129fb141393efa54287136272067343d48 | |
| parent | 78a8b4415163b8215d2a434a5dab4994871a4fc4 (diff) | |
| download | django-debug-toolbar-c20e83fc946c8898d40b0210f71286575891ae94.tar.bz2 | |
Correct some issues with the stats methods
| -rw-r--r-- | debug_toolbar/panels/__init__.py | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py index 584ddb7..baebf02 100644 --- a/debug_toolbar/panels/__init__.py +++ b/debug_toolbar/panels/__init__.py @@ -41,10 +41,14 @@ class DebugPanel(object):          raise NotImplementedError      def record_stats(self, stats): -        self.toolbar.stats[self.slug].update(stats) +        panel_stats = self.toolbar.stats.get(self.slug) +        if panel_stats: +            panel_stats.update(stats) +        else: +            self.toolbar.stats[self.slug] = stats      def get_stats(self): -        return self.toolbar.stats[self.slug] +        return self.toolbar.stats.get(self.slug, {})      # Standard middleware methods      def process_request(self, request): | 
