From ccf21c76ddadb6744cca59bd4639752005e187fa Mon Sep 17 00:00:00 2001 From: pskl Date: Tue, 22 Oct 2024 12:19:04 +0200 Subject: [PATCH] Open the doors to the sygne demonic realm --- app/jobs/sync/classes_job.rb | 5 ----- app/jobs/sync/student_job.rb | 1 - app/jobs/sync/student_schoolings_job.rb | 12 ++---------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/jobs/sync/classes_job.rb b/app/jobs/sync/classes_job.rb index 355fb72dd..23dbc265e 100644 --- a/app/jobs/sync/classes_job.rb +++ b/app/jobs/sync/classes_job.rb @@ -20,11 +20,6 @@ class ClassesJob < ApplicationJob end def perform(establishment, school_year) - # NOTE: there is a bug in Sygne where students are removed from classes - # earlier than they should be so we disable student list fetching for now - # (only in production because we want to keep our tests intact) - return true if establishment.provided_by?(:sygne) && Rails.env.production? - api = establishment.students_api api diff --git a/app/jobs/sync/student_job.rb b/app/jobs/sync/student_job.rb index 156022955..cb2d22a30 100644 --- a/app/jobs/sync/student_job.rb +++ b/app/jobs/sync/student_job.rb @@ -7,7 +7,6 @@ class StudentJob < ApplicationJob def perform(schooling) student = schooling.student - return true if schooling.establishment.provided_by?(:sygne) && Rails.env.production? return true if student.ine_not_found || schooling.closed? fetch_student_data(schooling) diff --git a/app/jobs/sync/student_schoolings_job.rb b/app/jobs/sync/student_schoolings_job.rb index e9a9eddbc..077c312a0 100644 --- a/app/jobs/sync/student_schoolings_job.rb +++ b/app/jobs/sync/student_schoolings_job.rb @@ -12,17 +12,9 @@ class StudentSchoolingsJob < ApplicationJob retry_on Faraday::TooManyRequestsError, wait: 1.hour, attempts: 3 def perform(student) - # There are students with no schoolings at all + # NOTE: There are students with no schoolings at all # Student.where.missing(:schoolings).count - return true if student.establishment.blank? - - # XXX: Sygne temporarily disabled see issue: - # https://github.com/orgs/betagouv/projects/71/views/1?pane=issue&itemId=70119483 - if (student.establishment.provided_by?(:sygne) && Rails.env.production?) || student.current_schooling.nil? - return true - end - - return true if student.current_schooling.removed? + return true if student.establishment.blank? || student.current_schooling.removed? Updaters::StudentSchoolingsUpdater.call(student) end