Skip to content

Commit

Permalink
Remove duplicated code in routes.py (#8565)
Browse files Browse the repository at this point in the history
* Update routes.py

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
sadra-barikbin and gradio-pr-bot authored Jun 19, 2024
1 parent 56af40f commit fd5aab1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/slick-dancers-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Remove duplicated code in `routes.py`
4 changes: 2 additions & 2 deletions gradio/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def main(request: fastapi.Request, user: str = Depends(get_current_user)):
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(
Expand All @@ -392,7 +392,7 @@ def main(request: fastapi.Request, user: str = Depends(get_current_user)):
config = {
"auth_required": True,
"auth_message": blocks.auth_message,
"space_id": app.get_blocks().space_id,
"space_id": blocks.space_id,
"root": root,
}

Expand Down

0 comments on commit fd5aab1

Please sign in to comment.