Skip to content

Commit

Permalink
Fik flaky invoice specs (#1856)
Browse files Browse the repository at this point in the history
add guard in method
  • Loading branch information
apoorv1316 authored Jun 7, 2024
1 parent 575667d commit b2c2627
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/timesheet_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def validate_billable_project
end

def prevent_edit_if_locked
return if Current.user.nil?

if locked && Current.user.primary_role(Current.company) == "employee"
errors.add(:base, "Cannot edit a locked timesheet entry. Please contact admin.")
end
Expand Down

0 comments on commit b2c2627

Please sign in to comment.