diff --git a/app/controllers/conference_administration_controller.rb b/app/controllers/conference_administration_controller.rb index 1d2fd2b..13af7fc 100644 --- a/app/controllers/conference_administration_controller.rb +++ b/app/controllers/conference_administration_controller.rb @@ -342,11 +342,6 @@ class ConferenceAdministrationController < ApplicationController end def administrate_stats - if @this_conference.start_date.blank? || @this_conference.end_date.blank? - @warning_message = :no_date_warning - return - end - get_stats(!request.format.xlsx?) if request.format.xlsx? @@ -355,6 +350,16 @@ class ConferenceAdministrationController < ApplicationController format.xlsx { render xlsx: '../conferences/stats', filename: "stats-#{DateTime.now.strftime('%Y-%m-%d')}" } end else + @past_conferences = [] + Conference.all.order("start_date DESC").each do |conference| + @past_conferences << conference if conference.is_public && @this_conference.id != conference.id + end + + if @this_conference.start_date.blank? || @this_conference.end_date.blank? + @warning_message = :no_date_warning + return + end + @registration_count = @registrations.size @completed_registrations = 0 @bikes = 0 @@ -378,11 +383,6 @@ class ConferenceAdministrationController < ApplicationController end end end - - @past_conferences = [] - Conference.all.order("start_date DESC").each do |conference| - @past_conferences << conference if conference.is_public && @this_conference.id != conference.id - end end end