diff --git a/cesium_app/handlers/project.py b/cesium_app/handlers/project.py index 4e30114..71de118 100644 --- a/cesium_app/handlers/project.py +++ b/cesium_app/handlers/project.py @@ -29,7 +29,7 @@ def post(self): p = Project.add_by(data['projectName'], data.get('projectDescription', ''), self.get_username()) - self.action('cesium/FETCH_DATASETS') + return self.success({"id": p.id}, 'cesium/FETCH_PROJECTS') def put(self, project_id): diff --git a/cesium_app/models.py b/cesium_app/models.py index 75cb71d..52111ff 100644 --- a/cesium_app/models.py +++ b/cesium_app/models.py @@ -12,10 +12,7 @@ from cesium_app.json_util import to_json from cesium_app.config import cfg -from cesium import featurize, data_management - -import shutil -from os.path import join as pjoin +from cesium import featurize db = pw.PostgresqlDatabase(autocommit=True, autorollback=True, @@ -52,17 +49,6 @@ def add_by(name, description, username): with db.atomic(): p = Project.create(name=name, description=description) UserProject.create(username=username, project=p) - - # Add example dataset to project, similar to create_test_dataset - header = pjoin(os.path.dirname(__file__), - 'tests', 'data', 'asas_training_subset_classes.dat') - tarball = pjoin(os.path.dirname(__file__), - 'tests', 'data', 'asas_training_subset.tar.gz') - header = shutil.copy2(header, cfg['paths']['upload_folder']) - tarball = shutil.copy2(tarball, cfg['paths']['upload_folder']) - ts_paths = data_management.parse_and_store_ts_data( - tarball, cfg['paths']['ts_data_folder'], header) - Dataset.add(name='Example Dataset', project=p, file_uris=ts_paths).save() return p def is_owned_by(self, username):