From 9f1a54ffe81a1d5e59c7511f8ee03f2a43b25847 Mon Sep 17 00:00:00 2001
From: pabois <pierreandre.boissinot@noesya.coop>
Date: Mon, 10 Jul 2023 17:22:56 +0200
Subject: [PATCH] adjust

---
 app/models/university/person.rb                | 12 ++++++------
 app/views/admin/dashboard/index.html.erb       |  2 +-
 app/views/admin/research/theses/_form.html.erb |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/app/models/university/person.rb b/app/models/university/person.rb
index 0b3977be3..8ff4a6202 100644
--- a/app/models/university/person.rb
+++ b/app/models/university/person.rb
@@ -137,12 +137,12 @@ class University::Person < ApplicationRecord
 
   before_validation :sanitize_email, :prepare_name
 
-  scope :ordered,         -> { order(:last_name, :first_name) }
-  scope :administration,  -> { where(is_administration: true) }
-  scope :teachers,        -> { where(is_teacher: true) }
-  scope :researchers,     -> { where(is_researcher: true) }
-  scope :alumni,          -> { where(is_alumnus: true) }
-  scope :accredited,      -> { where(habilitation: true) }
+  scope :ordered,           -> { order(:last_name, :first_name) }
+  scope :administration,    -> { where(is_administration: true) }
+  scope :teachers,          -> { where(is_teacher: true) }
+  scope :researchers,       -> { where(is_researcher: true) }
+  scope :alumni,            -> { where(is_alumnus: true) }
+  scope :with_habilitation, -> { where(habilitation: true) }
   scope :for_role, -> (role) { where("is_#{role}": true) }
   scope :for_category, -> (category_id) { includes(:categories).where(categories: { id: category_id })}
   scope :for_program, -> (program_id) {
diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb
index ae580906e..9a9ca4675 100644
--- a/app/views/admin/dashboard/index.html.erb
+++ b/app/views/admin/dashboard/index.html.erb
@@ -23,7 +23,7 @@
   </div>
 </div>
 
-<%= render 'admin/application/favorites/show' if current_user.favorites.any? %>
+<%= render 'admin/application/favorites/show' %>
 
 <div class="row mt-5 pt-5">
   <% @namespaces.each do |namespace| %>
diff --git a/app/views/admin/research/theses/_form.html.erb b/app/views/admin/research/theses/_form.html.erb
index 3b9e0d97c..3d533dc00 100644
--- a/app/views/admin/research/theses/_form.html.erb
+++ b/app/views/admin/research/theses/_form.html.erb
@@ -21,7 +21,7 @@
       <%= f.association :director,
                         collection: current_university.people
                                                       .for_language_id(current_university.default_language_id)
-                                                      .accredited
+                                                      .with_habilitation
                                                       .ordered %>
     </div>
   </div>
-- 
GitLab