This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 394821f47a1575daa201a4f1d2542817d5f653da
Author: Jed Cunningham <[email protected]>
AuthorDate: Mon Apr 15 14:09:16 2024 -0400

    Hostname was "redacted", not "redact"; remove it when there is no context 
(#39037)
    
    (cherry picked from commit 82e51760a12a95c6b79e0ca14c575a920a62b2ca)
---
 airflow/www/auth.py  |  6 ++----
 airflow/www/views.py | 10 +++++-----
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/airflow/www/auth.py b/airflow/www/auth.py
index 1b3753f87d..f3f36e05e3 100644
--- a/airflow/www/auth.py
+++ b/airflow/www/auth.py
@@ -167,7 +167,7 @@ def _has_access(*, is_authorized: bool, func: Callable, 
args, kwargs):
         return (
             render_template(
                 "airflow/no_roles_permissions.html",
-                hostname=get_hostname() if conf.getboolean("webserver", 
"EXPOSE_HOSTNAME") else "redact",
+                hostname=get_hostname() if conf.getboolean("webserver", 
"EXPOSE_HOSTNAME") else "",
                 logout_url=get_auth_manager().get_url_logout(),
             ),
             403,
@@ -234,9 +234,7 @@ def has_access_dag(method: ResourceMethod, access_entity: 
DagAccessEntity | None
                 return (
                     render_template(
                         "airflow/no_roles_permissions.html",
-                        hostname=get_hostname()
-                        if conf.getboolean("webserver", "EXPOSE_HOSTNAME")
-                        else "redact",
+                        hostname=get_hostname() if 
conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "",
                         logout_url=get_auth_manager().get_url_logout(),
                     ),
                     403,
diff --git a/airflow/www/views.py b/airflow/www/views.py
index ce0727ab4d..5bdebe5d91 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -632,7 +632,7 @@ def not_found(error):
     return (
         render_template(
             "airflow/error.html",
-            hostname=get_hostname() if conf.getboolean("webserver", 
"EXPOSE_HOSTNAME") else "redact",
+            hostname=get_hostname() if conf.getboolean("webserver", 
"EXPOSE_HOSTNAME") else "",
             status_code=404,
             error_message="Page cannot be found.",
         ),
@@ -645,7 +645,7 @@ def method_not_allowed(error):
     return (
         render_template(
             "airflow/error.html",
-            hostname=get_hostname() if conf.getboolean("webserver", 
"EXPOSE_HOSTNAME") else "redact",
+            hostname=get_hostname() if conf.getboolean("webserver", 
"EXPOSE_HOSTNAME") else "",
             status_code=405,
             error_message="Received an invalid request.",
         ),
@@ -659,11 +659,11 @@ def show_traceback(error):
     return (
         render_template(
             "airflow/traceback.html",
-            python_version=sys.version.split(" ")[0] if is_logged_in else 
"redact",
-            airflow_version=version if is_logged_in else "redact",
+            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 "redact",
+            else "redacted",
             info=traceback.format_exc()
             if conf.getboolean("webserver", "EXPOSE_STACKTRACE") and 
is_logged_in
             else "Error! Please contact server admin.",

Reply via email to