Skip to content

Commit

Permalink
add warning if a public asset has been created
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
  • Loading branch information
nhoening committed Jun 15, 2023
1 parent 2fa7ec7 commit b0a4a8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flexmeasures/cli/data_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ def add_asset(**args):
"""Add an asset."""
check_errors(GenericAssetSchema().validate(args))
generic_asset = GenericAsset(**args)
if generic_asset.account_id is None:
click.secho(
"Creating a PUBLIC asset, as the account_id is not given ...",
**MsgStyle.WARN,
)
db.session.add(generic_asset)
db.session.commit()
click.secho(
Expand All @@ -329,7 +334,7 @@ def add_initial_structure():
"--name",
required=True,
type=str,
help="Name of the source (usually an organisation)",
help="Name of the source (usually an organization)",
)
@click.option(
"--model",
Expand Down

0 comments on commit b0a4a8f

Please sign in to comment.