Skip to content

Commit c60daa2

Browse files
committed
fixup! Fix #321
1 parent 450314b commit c60daa2

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- Stylize prompt to create new project or tag (#310).
1717
- Aggregate calculates wrong time if used with `--current` (#293)
18+
- `watson start` now correctly checks if project is empty (#322)
1819

1920
## [1.8.0] - 2019-08-26
2021

watson/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def start(ctx, watson, confirm_new_project, confirm_new_tag, args, gap_=True):
203203
itertools.takewhile(lambda s: not s.startswith('+'), args)
204204
)
205205
if not project:
206-
raise _watson.WatsonError("No project given.")
206+
raise click.ClickException("No project given.")
207207

208208
# Confirm creation of new project if that option is set
209209
if (watson.config.getboolean('options', 'confirm_new_project') or
@@ -1131,7 +1131,7 @@ def add(watson, args, from_, to, confirm_new_project, confirm_new_tag):
11311131
itertools.takewhile(lambda s: not s.startswith('+'), args)
11321132
)
11331133
if not project:
1134-
raise _watson.WatsonError("No project given.")
1134+
raise click.ClickException("No project given.")
11351135

11361136
# Confirm creation of new project if that option is set
11371137
if (watson.config.getboolean('options', 'confirm_new_project') or

watson/watson.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ def add(self, project, from_date, to_date, tags):
252252
return frame
253253

254254
def start(self, project, tags=None, restart=False, gap=True):
255-
if not project:
256-
raise WatsonError("No project given.")
257-
258255
if self.is_started:
259256
raise WatsonError(
260257
u"Project {} is already started.".format(

0 commit comments

Comments
 (0)