Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Send a useful message when missing arg (#161)
Browse files Browse the repository at this point in the history
For the lock action
  • Loading branch information
parberge authored Jun 11, 2020
1 parent c734ded commit 79b02d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chalicelib/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ def _lock_action(self):
/timereport lock 2019-08
"""
if not self.arguments:
return self.send_response(
f"Missing required argument. Here is an helpful message: {self._lock_action.__doc__}"
)

event = create_lock(user_id=self.user_id, event_date=self.params[1])
log.debug(f"lock event: {event}")
response = lock_event(url=self.config["backend_url"], event=json.dumps(event))
Expand Down

0 comments on commit 79b02d7

Please sign in to comment.