}
# do not overwrite staff member if you do not have the right
- delete $attributes{staff_member_id} if !$_[0]->can_edit_all;
- $attributes{staff_member_id} = SL::DB::Manager::Employee->current->id if $is_new;
+ delete $attributes{staff_member_id} if !$_[0]->can_edit_all;
+ $attributes{staff_member_id} ||= SL::DB::Manager::Employee->current->id if $is_new;
- $attributes{employee_id} = SL::DB::Manager::Employee->current->id;
+ $attributes{employee_id} = SL::DB::Manager::Employee->current->id;
$time_recording->assign_attributes(%attributes);