Skip to content

Commit fd5aab1

Browse files
Remove duplicated code in routes.py (#8565)
* Update routes.py * add changeset --------- Co-authored-by: gradio-pr-bot <[email protected]>
1 parent 56af40f commit fd5aab1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/slick-dancers-lie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gradio": minor
3+
---
4+
5+
feat:Remove duplicated code in `routes.py`

gradio/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def main(request: fastapi.Request, user: str = Depends(get_current_user)):
382382
request=request, route_path="/", root_path=app.root_path
383383
)
384384
if (app.auth is None and app.auth_dependency is None) or user is not None:
385-
config = app.get_blocks().config
385+
config = blocks.config
386386
config = route_utils.update_root_in_config(config, root)
387387
elif app.auth_dependency:
388388
raise HTTPException(
@@ -392,7 +392,7 @@ def main(request: fastapi.Request, user: str = Depends(get_current_user)):
392392
config = {
393393
"auth_required": True,
394394
"auth_message": blocks.auth_message,
395-
"space_id": app.get_blocks().space_id,
395+
"space_id": blocks.space_id,
396396
"root": root,
397397
}
398398

0 commit comments

Comments
 (0)