Commit 6b1a4386 authored by Michal Čihař's avatar Michal Čihař

Override server error handler to get own context processors into this page

parent 65206abe
......@@ -27,6 +27,7 @@ from django.db.models import Sum, Count, Q
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
import django.views.defaults
from weblate.trans.models import (
Project, SubProject, Translation, Check,
......@@ -404,6 +405,20 @@ def not_found(request):
)
def server_error(request):
'''
Error handler for server erros.
'''
try:
return render(
request,
'500.html',
status=500
)
except Exception:
return django.views.defaults.server_error(request)
def about(request):
'''
Shows about page with version information.
......
......@@ -53,6 +53,8 @@ admin.autodiscover()
handler404 = 'weblate.trans.views.basic.not_found'
handler500 = 'weblate.trans.views.basic.server_error'
admin.site.index_template = 'admin/custom-index.html'
urlpatterns = patterns(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment