Skip to content

Commit

Permalink
update project settings when creating project
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Mar 14, 2024
1 parent 4568843 commit 00a70ae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/projects/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ def post(self) -> Project:
parser.add_argument(name="visibility", type=int)
parser.add_argument(name="config", type=str)
parser.add_argument(name="language", type=str)
parser.add_argument(name="conllSchema", type=dict, action="append")
args = parser.parse_args()
projectName = args.projectName
project_name = args.projectName

new_project_attrs: ProjectInterface = {
"project_name": projectName,
"project_name": project_name,
"description": args.description,
"blind_annotation_mode": args.blindAnnotationMode,
"visibility": args.visibility,
Expand All @@ -127,7 +128,7 @@ def post(self) -> Project:

new_project = ProjectService.create(new_project_attrs)
LastAccessService.update_last_access_per_user_and_project(
creator_id, projectName, "write"
creator_id, project_name, "write"
)

ProjectAccessService.create(
Expand All @@ -150,6 +151,8 @@ def post(self) -> Project:
ProjectMetaFeatureService.create(
{"project_id": new_project.id, "value": feature}
)
dumped_project_config = json.dumps(args.get("conllSchema"))
GrewService.update_project_config(project_name, dumped_project_config)

return new_project

Expand Down

0 comments on commit 00a70ae

Please sign in to comment.