Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: zhihuiwan <[email protected]>
  • Loading branch information
zhihuiwan committed Dec 29, 2023
1 parent 40371eb commit aa3dbb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/fate_flow/apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def get_app_module(page_path):

def register_page(page_path, func=None, prefix=API_VERSION):
page_name = page_path.stem.rstrip('app').rstrip("_")
module_name = '.'.join(page_path.parts[page_path.parts.index('fate_flow')+2:-1] + (page_name, ))
fate_flow_index = len(page_path.parts) - 1 - page_path.parts[::-1].index("fate_flow")
module_name = '.'.join(page_path.parts[fate_flow_index:-1] + (page_name, ))
spec = spec_from_file_location(module_name, page_path)
page = module_from_spec(spec)
page.app = app
Expand Down

0 comments on commit aa3dbb0

Please sign in to comment.