Commit 899d4065 authored by Julian Rother's avatar Julian Rother
Browse files

Fixed recursive error_handler calls (e.g. lecture page with invalid id)

parent 5a4260e4
from flask import Flask, g, request, url_for, redirect, session, render_template, flash, Response from flask import Flask, g, request, url_for, redirect, session, render_template, flash, Response, make_response
from werkzeug.routing import Rule from werkzeug.routing import Rule
from functools import wraps from functools import wraps
from datetime import date, timedelta, datetime, time, MINYEAR from datetime import date, timedelta, datetime, time, MINYEAR
...@@ -162,7 +162,7 @@ def handle_errors(endpoint, text, code, *errors, **epargs): ...@@ -162,7 +162,7 @@ def handle_errors(endpoint, text, code, *errors, **epargs):
return func(*args, **kwargs) return func(*args, **kwargs)
except errors: except errors:
if endpoint: if endpoint:
return render_endpoint(endpoint, text, **epargs), code return make_response(render_endpoint(endpoint, text, **epargs), code)
else: else:
return text, code return text, code
return decorator return decorator
......
Supports Markdown
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