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 af9cdd2833
commit 5d39652431
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0
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