From 9594f5be7daa673b88654e0f47db07d1c1454765 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 16 Aug 2016 22:19:39 +0200 Subject: Move registration open check to before filter. --- registration.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'registration.rb') diff --git a/registration.rb b/registration.rb index e85fc47..f7a31b0 100644 --- a/registration.rb +++ b/registration.rb @@ -13,11 +13,13 @@ class RegistrationApp < Sinatra::Base config_file File.join(settings.root, 'config.yml') - get '/' do + before do if !accept_registrations(settings) - return erb :registration_closed + halt erb :registration_closed end + end + get '/' do @band = Band.new 3.times { @band.songs << Song.new } erb :index -- cgit v1.2.3