Skip to content

Commit

Permalink
fix: remove custom 500 handler
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobernardoaf committed May 9, 2024
1 parent c7ee64a commit 90bf12b
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions temba/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

from temba.channels.views import register, sync

from .views import WeniRedirect

# javascript translation packages
js_info_dict = {"packages": ()} # this is empty due to the fact that all translation are in one folder

Expand Down Expand Up @@ -41,7 +39,6 @@
re_path(r"^imports/", include("smartmin.csv_imports.urls")),
re_path(r"^assets/", include("temba.assets.urls")),
re_path(r"^jsi18n/$", JavaScriptCatalog.as_view(), js_info_dict, name="django.views.i18n.javascript_catalog"),
re_path(r"^redirect/", WeniRedirect.as_view(), {}, "weni.redirect"),
]

if settings.DEBUG:
Expand All @@ -51,33 +48,3 @@
# import any additional urls
for app in settings.APP_URLS: # pragma: needs cover
urlpatterns.append(re_path(r"^", include(app)))


def handler500(request):
"""
500 error handler which includes ``request`` in the context.
Templates: `500.html`
Context: None
"""
from sentry_sdk import last_event_id

from django.http import HttpResponseServerError
from django.template import loader

from .settings import BRANDING, DEFAULT_BRAND
from .context_processors_weni import use_weni_layout

weni_layout = use_weni_layout(request)

t = loader.get_template("500.html")
return HttpResponseServerError(
t.render(
{
"request": request,
"brand": BRANDING[DEFAULT_BRAND],
"use_weni_layout": weni_layout["use_weni_layout"],
"sentry_id": last_event_id(),
}
)
)

0 comments on commit 90bf12b

Please sign in to comment.