Skip to content

Commit

Permalink
the middleware bug fix which is case of HTTP_USER_AGENT missing
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebamus committed Feb 7, 2024
1 parent d567f3b commit b3ec137
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_middlewares/common/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def stats(self, os_info):
count.update(oth=F("oth") + 1)

def __call__(self, request):
if "admin" not in request.path:
self.stats(request.META["HTTP_USER_AGENT"])
if "HTTP_USER_AGENT" in request.META:
if "admin" not in request.path:
self.stats(request.META["HTTP_USER_AGENT"])

response = self.get_response(request)

Expand Down

0 comments on commit b3ec137

Please sign in to comment.