Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def __init__(self, appbuilder) -> None:
@staticmethod
def before_request():
"""Run hook before request."""
g.user = get_auth_manager().get_user()
if hasattr(get_auth_manager(), "get_user"):
g.user = get_auth_manager().get_user()

def create_limiter(self) -> Limiter:
app = self.appbuilder.get_app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ <h1> Ooops! </h1>
* only after you tried it all, and have difficulty with diagnosing and fixing the problem yourself,
get the logs with errors, describe results of your investigation so far, and consider creating a
<b><a href="https://github.com/apache/airflow/issues/new/choose">bug report</a></b> including this information.

Python version: {{ python_version }}
Airflow version: {{ airflow_version }}
Node: {{ hostname }}
-------------------------------------------------------------------------------
{{ info }}</pre>
</pre>
</div>
</div>
</body>
Expand Down
24 changes: 1 addition & 23 deletions providers/fab/src/airflow/providers/fab/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# under the License.
from __future__ import annotations

import sys
import traceback
from urllib.parse import unquote, urljoin, urlsplit

from flask import (
Expand All @@ -32,8 +30,6 @@

from airflow.api_fastapi.app import get_auth_manager
from airflow.configuration import conf
from airflow.utils.net import get_hostname
from airflow.version import version

# Following the release of https://github.com/python/cpython/issues/102153 in Python 3.9.17 on
# June 6, 2023, we are adding extra sanitization of the urls passed to get_safe_url method to make it works
Expand Down Expand Up @@ -77,25 +73,7 @@ def index(self):

def show_traceback(error):
"""Show Traceback for a given error."""
is_logged_in = get_auth_manager().is_logged_in()
return (
render_template(
"airflow/traceback.html",
python_version=sys.version.split(" ")[0] if is_logged_in else "redacted",
airflow_version=version if is_logged_in else "redacted",
hostname=(
get_hostname()
if conf.getboolean("webserver", "EXPOSE_HOSTNAME") and is_logged_in
else "redacted"
),
info=(
Comment thread
vincbeck marked this conversation as resolved.
traceback.format_exc()
if conf.getboolean("webserver", "EXPOSE_STACKTRACE") and is_logged_in
else "Error! Please contact server admin."
),
),
500,
)
return render_template("airflow/traceback.html"), 500


def not_found(error):
Expand Down