Skip to content

Commit

Permalink
Fix default project desc and show shared option in config
Browse files Browse the repository at this point in the history
  • Loading branch information
makseq committed Oct 24, 2020
1 parent cf963e9 commit c216398
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions label_studio/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,23 +268,24 @@ def setup_page():
input_values = {}
project = g.project

g.project.description = project.get_config(project.name, input_args).get('description')
g.project.description = project.get_config(project.name, input_args).get('description', 'Untitled')

if project.config.get("show_project_links_in_multisession", False) and hasattr(g, 'user'):
# evaluate all projects for this user: user_projects + shared_projects
if project.config.get("show_project_links_in_multisession", True) and hasattr(g, 'user'):
user = g.user
project_ids = g.project.get_user_projects(user, input_args.root_dir)

# own projects
project_names = [os.path.join(user, uuid) for uuid in project_ids]
project_desc = [Project.get_config(name, input_args).get('description') for name in project_names]
project_desc = [Project.get_config(name, input_args).get('description', 'Untitled') for name in project_names]
own_projects = dict(zip(project_ids, project_desc))

# shared projects
shared_projects = {}
for uuid in session.get('shared_projects', []):
tmp_user = Project.get_user_by_project(uuid, input_args.root_dir)
project_name = os.path.join(tmp_user, uuid)
project_desc = Project.get_config(project_name, input_args).get('description')
project_desc = Project.get_config(project_name, input_args).get('description', 'Untitled')
shared_projects[uuid] = project_desc
else:
own_projects, shared_projects = {}, {}
Expand Down

0 comments on commit c216398

Please sign in to comment.