fix revision history broken bug

Fixes https://github.com/openSUSE/osem/issues/2334
This commit is contained in:
Rahul 2019-02-28 00:07:16 +05:30
parent 1544cdd23e
commit a776641668
2 changed files with 9 additions and 5 deletions

View file

@ -6,12 +6,15 @@ module Admin
load_and_authorize_resource class: PaperTrail::Version
def index
@conferences_with_role = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role([:organizer, :cfp, :info_desk], current_user).pluck(:short_title)
if Conference.any?
@conferences_with_role = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role([:organizer, :cfp, :info_desk], current_user).pluck(:short_title)
@conferences_with_role.uniq!
end
if current_user.has_cached_role? :organization_admin, :any
@conferences_with_role = Organization.with_role('organization_admin', current_user).map { |org| org.conferences.pluck :short_title }.flatten
@conferences_with_role.uniq!
end
@conferences_with_role.uniq!
return if @conference.blank?