Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Stylize prompt to create new project or tag (#310).
- Aggregate calculates wrong time if used with `--current` (#293)
- The `start` command now correctly checks if project is empty (#322)

## [1.8.0] - 2019-08-26

Expand Down
4 changes: 4 additions & 0 deletions watson/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def start(ctx, watson, confirm_new_project, confirm_new_tag, args, gap_=True):
project = ' '.join(
itertools.takewhile(lambda s: not s.startswith('+'), args)
)
if not project:
raise click.ClickException("No project given.")

# Confirm creation of new project if that option is set
if (watson.config.getboolean('options', 'confirm_new_project') or
Expand Down Expand Up @@ -1143,6 +1145,8 @@ def add(watson, args, from_, to, confirm_new_project, confirm_new_tag):
project = ' '.join(
itertools.takewhile(lambda s: not s.startswith('+'), args)
)
if not project:
raise click.ClickException("No project given.")

# Confirm creation of new project if that option is set
if (watson.config.getboolean('options', 'confirm_new_project') or
Expand Down
3 changes: 0 additions & 3 deletions watson/watson.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ def add(self, project, from_date, to_date, tags):
return frame

def start(self, project, tags=None, restart=False, gap=True):
if not project:
raise WatsonError("No project given.")

if self.is_started:
raise WatsonError(
u"Project {} is already started.".format(
Expand Down