Fix debug toolbar integration
authorMagnus Hagander <magnus@hagander.net>
Wed, 24 Mar 2021 18:24:54 +0000 (19:24 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 24 Mar 2021 18:27:09 +0000 (19:27 +0100)
This was broken when the querystring limiter was put in place
in 0724c08e402d0bffb0eb53192c4363dac1311fe3.

pgweb/util/middleware.py

index 6a6e3dbf67cd2886ce1149a474141edd0fd77d95..1cf652a7bab059d802ddd757c8e323eb26752a91 100644 (file)
@@ -90,6 +90,10 @@ class PgMiddleware(object):
             # django-admin uses it a lot and it's not for us to change
             return None
 
+        if settings.DEBUG_TOOLBAR and request.path.startswith('/__debug__/'):
+            # The debug toolbar also uses a lot
+            return None
+
         allowed = getattr(view_func, 'queryparams', None)
 
         if allowed: