Remove duplicated code in routes.py (#8565)

* Update routes.py

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Sadra Barikbin 2024-06-19 17:39:10 +02:00 committed by GitHub
parent 56af40f5e3
commit fd5aab10be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": minor
---
feat:Remove duplicated code in `routes.py`

View File

@ -382,7 +382,7 @@ class App(FastAPI):
request=request, route_path="/", root_path=app.root_path
)
if (app.auth is None and app.auth_dependency is None) or user is not None:
config = app.get_blocks().config
config = blocks.config
config = route_utils.update_root_in_config(config, root)
elif app.auth_dependency:
raise HTTPException(
@ -392,7 +392,7 @@ class App(FastAPI):
config = {
"auth_required": True,
"auth_message": blocks.auth_message,
"space_id": app.get_blocks().space_id,
"space_id": blocks.space_id,
"root": root,
}