Introduces New Installation Page

If there are no users signed up and no conferences we show a page
informing people what they need to do.
This commit is contained in:
Henne Vogelsang 2019-01-29 21:20:44 +01:00
parent 7fd7090867
commit 0f5181ccf4
3 changed files with 29 additions and 4 deletions

View file

@ -265,12 +265,14 @@ class User < ApplicationRecord
proposals(conference).count
end
def self.empty?
User.count == 1 && User.first.email == 'deleted@localhost.osem'
end
private
def setup_role
if User.count == 1 && User.first.email == 'deleted@localhost.osem'
self.is_admin = true
end
self.is_admin = true if User.empty?
end
def touch_events