You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2020. It is now read-only.
Copy file name to clipboardexpand all lines: CHANGELOG.md
+5
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,11 @@ Changelog
5
5
* This file will be updated whenever a new release is put into production.
6
6
* Any problems should be reported via the "report an issue" link in the footer of the application.
7
7
8
+
### v3.4.9
9
+
*Released on 16 March 2015*
10
+
#### Bug Fixes
11
+
* Banned users can no longer have reservations created for them or equipment checked out to them ([#1185](https://github.com/YaleSTC/reservations/issues/1185)).
Copy file name to clipboardexpand all lines: app/controllers/reservations_controller.rb
+14-3
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ class ReservationsController < ApplicationController
13
13
14
14
defset_user
15
15
@user=User.find(params[:user_id])
16
+
returnunless@user.role == 'banned'
17
+
flash[:error]='This user is banned and cannot check out equipment.'
16
18
end
17
19
18
20
defset_reservation
@@ -53,7 +55,10 @@ def new
53
55
# error handling
54
56
@errors=cart.validate_all
55
57
unless@errors.empty?
56
-
ifcan?:override,:reservation_errors
58
+
if@errors[0].include?('banned')
59
+
flash[:error]='Reservations cannot be created for banned users.'
60
+
redirect_toroot_path
61
+
elsifcan?:override,:reservation_errors
57
62
flash[:error]='Are you sure you want to continue? Please review the errors below.'
58
63
else
59
64
flash[:error]='Please review the errors below. If uncorrected, any reservations with errors will be filed as a request, and subject to administrator approval.'
0 commit comments