Commit f5cb64a8 authored by Romain Therville's avatar Romain Therville 🐭

Update to the workflow addproject

The "project space" field in the form has been made a select field, with
options build dynamically.

issue #172
parent 12139447
......@@ -16,9 +16,8 @@
#
from jflow.workflow import Workflow
from ng6.project import Project
from ng6.config_reader import NG6ConfigReader
from workflows.types import ng6adminlogin, uniqproject, ng6space
class AddProject (Workflow):
......@@ -27,10 +26,13 @@ class AddProject (Workflow):
return "Add a brand new project"
def define_parameters(self, function="process"):
ng6conf = NG6ConfigReader()
space_choices = ng6conf.get_available_spaces()
self.add_parameter("admin_login", "The login of a ng6 administrator", required = True, type = ng6adminlogin)
self.add_parameter("project_name", "Give a name to your project (has to be unique)", flag = "--name", required = True, type = uniqproject)
self.add_parameter("project_description", "Give a description to your project", flag = "--description", required = True)
self.add_parameter("space", "Where to store data", flag = "--space", default="default", type=ng6space)
self.add_parameter("space", "Where to store data", flag = "--space", default="shortterm", type=ng6space, choices = space_choices)
def process(self):
project = Project(self.project_name, self.project_description, self.admin_login, None, self.space)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment