Skip to content

Commit

Permalink
fixed bug preventing users from clocking in
Browse files Browse the repository at this point in the history
  • Loading branch information
asherp committed Jan 30, 2020
1 parent a70d650 commit 6565bdd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions WorkLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* fixed bug preventing users from clocking in

### 2020-01-29 23:45:29.962519: clock-in

Expand Down
6 changes: 6 additions & 0 deletions hourly/hourly.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def get_labor_range(labor):


def is_clocked_in(clocks):
if clocks is None:
return None

clocked_in = clocks.message.str.contains('|'.join(['clock-in', 'clock in']), case = False).to_frame()
if len(clocked_in) > 0:
last_in = clocked_in.iloc[-1]
Expand All @@ -168,6 +171,9 @@ def is_clocked_in(clocks):
return None

def is_clocked_out(clocks):
if clocks is None:
return None

clocked_out = clocks.message.str.contains('|'.join(['clock-out', 'clock out']), case = False).to_frame()
if len(clocked_out) > 0:
last_out = clocked_out.iloc[-1]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = hourly
version = 0.3.12
version = 0.3.13
author = Asher Pembroke
author_email = [email protected]
description = A time tracking tool for git repos
Expand Down

0 comments on commit 6565bdd

Please sign in to comment.