(self, request)
| 13 | self.get_response = get_response |
| 14 | |
| 15 | def __call__(self, request): # type: ignore[no-untyped-def] |
| 16 | if request.path.startswith("/admin"): |
| 17 | ip = get_ip_address_from_request(request) |
| 18 | if ( |
| 19 | settings.ALLOWED_ADMIN_IP_ADDRESSES |
| 20 | and ip not in settings.ALLOWED_ADMIN_IP_ADDRESSES |
| 21 | ): |
| 22 | # IP address not allowed! |
| 23 | logger.info("Denying access to admin for ip address %s" % ip) |
| 24 | raise PermissionDenied() |
| 25 | |
| 26 | return self.get_response(request) |
nothing calls this directly
no test coverage detected