File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1811,7 +1811,7 @@ def api_session(): # type: ignore[return]
18111811 global SESSION_USERNAME , SKIP_SESSION
18121812
18131813 if flask_request .method == 'GET' : # type: ignore
1814- return jsonify (get_web_dashboard_session_data ()) # type: ignore
1814+ return jsonify (apply_privacy_substitutions ( get_web_dashboard_session_data () )) # type: ignore
18151815 elif flask_request .method == 'POST' : # type: ignore
18161816 data = flask_request .get_json () # type: ignore
18171817 if not data :
@@ -3772,7 +3772,10 @@ def apply_privacy_substitutions(content: TPrivacyContent) -> TPrivacyContent:
37723772 content_str = content_str .replace (search , replace )
37733773 return cast (TPrivacyContent , content_str )
37743774 if isinstance (content , dict ):
3775- return cast (TPrivacyContent , {k : apply_privacy_substitutions (v ) for k , v in content .items ()})
3775+ return cast (TPrivacyContent , {
3776+ apply_privacy_substitutions (k ) if isinstance (k , str ) else k : apply_privacy_substitutions (v )
3777+ for k , v in content .items ()
3778+ })
37763779 if isinstance (content , list ):
37773780 return cast (TPrivacyContent , [apply_privacy_substitutions (item ) for item in content ])
37783781 return content
You can’t perform that action at this time.
0 commit comments