Commit 547225c4 authored by lauren j's avatar lauren j

system/roster: Fix a couple nil-value bugs in override

parent 7841d4b9
Pipeline #177477410 passed with stage
in 54 seconds
......@@ -102,7 +102,7 @@ class ReConnect::Controllers::SystemVolunteerRosterController < ReConnect::Contr
# POST actions follow
if request.params['delete']&.strip.to_i.positive?
@vre.delete
@vre&.delete
flash :success, t(:'system/roster/override/delete/success', :date => @date)
return redirect @back
......@@ -114,7 +114,7 @@ class ReConnect::Controllers::SystemVolunteerRosterController < ReConnect::Contr
return redirect request.path
end
@vre.delete
@vre&.delete
@nvre = ReConnect::Models::VolunteerRosterEntry.new(user_id: override_user.id, roster_day: @date)
@nvre.is_admin_override = true
@nvre.save
......
......@@ -28,7 +28,7 @@
%label{:for => "choose_user"}= t(:'system/roster/override/choose/users')
%select#choose_user{:name => 'user', :required => true}
- users.each do |u|
%option{:value => u.id, :selected => (vre.user_id == u.id)}
%option{:value => u.id, :selected => (!vre.nil?() && vre&.user_id == u.id)}
= t(:'system/roster/override/choose/user_entry', :name => u.get_name.join(' '), :uid => u.id)
%button.pure-button.button.button-primary{:type => 'submit'}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment