Skip to content

Commit

Permalink
make middleware init signature compatible with django 4 (#322)
Browse files Browse the repository at this point in the history
* make middleware init signature compatible with django 4

Signed-off-by: Oleg Hoefling <[email protected]>

* reformat codebase with black

Signed-off-by: Oleg Hoefling <[email protected]>
  • Loading branch information
hoefling authored Jul 14, 2022
1 parent 57a7ad7 commit 951ab49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions django_prometheus/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ class PrometheusBeforeMiddleware(MiddlewareMixin):

metrics_cls = Metrics

def __init__(self, get_response=None):
super().__init__(get_response)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.metrics = self.metrics_cls.get_instance()

def process_request(self, request):
Expand All @@ -213,8 +213,8 @@ class PrometheusAfterMiddleware(MiddlewareMixin):

metrics_cls = Metrics

def __init__(self, get_response=None):
super().__init__(get_response)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.metrics = self.metrics_cls.get_instance()

def _transport(self, request):
Expand Down

0 comments on commit 951ab49

Please sign in to comment.