from django.template.response import SimpleTemplateResponse
from django.utils.translation import gettext_lazy as _

from debug_toolbar.panels import Panel


class RedirectsPanel(Panel):
    """
    Panel that intercepts redirects and displays a page with debug info.
    """

    has_content = False

    nav_title = _("Intercept redirects")

    def process_request(self, request):
        response = super().process_request(request)
        if 300 <= int(response.status_code) < 400:
            redirect_to = response.get("Location", None)
            if redirect_to:
                status_line = "{} {}".format(
                    response.status_code, response.reason_phrase
                )
                cookies = response.cookies
                context = {"redirect_to": redirect_to, "status_line": status_line}
                # Using SimpleTemplateResponse avoids running global context processors.
                response = SimpleTemplateResponse(
                    "debug_toolbar/redirect.html", context
                )
                response.cookies = cookies
                response.render()
        return response

from django.template.response import SimpleTemplateResponse
from django.utils.translation import gettext_lazy as _

from debug_toolbar.panels import Panel


class RedirectsPanel(Panel):
    """
    Panel that intercepts redirects and displays a page with debug info.
    """

    has_content = False

    nav_title = _("Intercept redirects")

    def process_request(self, request):
        response = super().process_request(request)
        if 300 <= response.status_code < 400:
            redirect_to = response.get("Location", None)
            if redirect_to:
                status_line = "{} {}".format(
                    response.status_code, response.reason_phrase
                )
                cookies = response.cookies
                context = {"redirect_to": redirect_to, "status_line": status_line}
                # Using SimpleTemplateResponse avoids running global context processors.
                response = SimpleTemplateResponse(
                    "debug_toolbar/redirect.html", context
                )
                response.cookies = cookies
                response.render()
        return response

Remove unnecessary coerce to int
Remove unnecessary coerce to int

Since Django commit
https://github.com/django/django/commit/190d2ff4a7a392adfe0b12552bd71871791d87aa
HttpResponse.status_code is always an int.
