This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xml_response = Hesa::Client.get(url: "https://datacollection.hesa.ac.uk/apis/itt/1.1/CensusData/C23053/2023-10-26") | |
student_nodes = Nokogiri::XML::Reader(xml_response).filter_map do |node| | |
Nokogiri::XML(node.outer_xml).at("./Student") if node.name == "Student" && node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT | |
end | |
students = student_nodes.map do |student_node| | |
# student_attributes = Hash.from_xml(student_node.to_s)["Student"] | |
Hesa::Parsers::IttRecord.to_attributes(student_node:) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
corrections_required = [ | |
["31009504/2/01","21100057900000137","2110750097246"], | |
["29002623/2/01","19100057900000123","1910750059931"], | |
["27034456/2/01","17100057900000163","1710750123984"], | |
["29020818/3/01","19100057900000536","1910750071885"], | |
["31021585/2/01","21100057900000023","2110750005355"], | |
["29024742/2/01","19100057900000570","1910750074015"], | |
["28012376/2/01","18100057900000148","1810750151559"], | |
["29005947/3/01","19100057900000824","1910750026715"], | |
["28016860/3/01","18100057900000182","1810750164696"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- NOTE: index scan indicator for busy table | |
SELECT | |
relname | |
, idx_scan | |
, last_idx_scan | |
FROM | |
pg_stat_user_tables | |
ORDER BY | |
idx_scan DESC | |
, relname ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
# NOTE: OPTION 2 | |
# Not checked need to be checked | |
############################# | |
raise "no checked" | |
course = RecruitmentCycle.current.previous.providers.find_by(provider_code: "EEU").first | |
dupes = [["L050", course], "R301",course, "E293", course, "K596", course] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please could Computing (3379) at Carmel College (1KF) have its withdrawal reverted | |
course = RecruitmentCycle.current.providers.find_by(provider_code: "1KF").courses.find_by(course_code: "3379") | |
course.enrichments.max_by(&:created_at).update(status: "published", last_published_timestamp_utc: Time.now.utc) | |
course.site_statuses.each do |site_status| | |
site_status.update(vac_status: :no_vacancies, status: :running) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copier = Courses::CopyToProviderService.new(sites_copy_to_course: Sites::CopyToCourseService, enrichments_copy_to_course: Enrichments::CopyToCourseService.new, force: true) | |
[ | |
["1KN", "4B5"], | |
["1KY", "5B3"], | |
["1BK", "3M1"], | |
["2CC", "2O2"], | |
["1CU", "3V2"], | |
].each do |source, target| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.publish-teacher-training-courses.service.gov.uk/publish/organisations/1A8/2024/courses/372X | |
# https://www.publish-teacher-training-courses.service.gov.uk/publish/organisations/1A8/2024/courses/3735 | |
# | |
# to no | |
courses = RecruitmentCycle.current.providers.find_by(provider_code: "1A8").courses.where(course_code: ["372X", "3735" ] ) | |
courses.update!(can_sponsor_student_visa: false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.publish-teacher-training-courses.service.gov.uk/publish/organisations/2JJ/2024/courses | |
# | |
# Change to yes | |
courses = RecruitmentCycle.current.providers.find_by(provider_code: "2JJ").courses | |
courses.update!(can_sponsor_student_visa: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Before state | |
run_me = false | |
(Provider.find_by(code: "EEU")) if run_me | |
#<Provider:0x00007fe5328a0768 id: 2619, name: "University of Ellucian", code: "EEU", created_at: Wed, 24 Feb 2021 12:23:48.431310000 GMT +00:00, updated_at: Mon, 20 Feb 2023 05:50:44.486124000 GMT +00:00, region_code: nil, postcode: "", provider_type: "university", latitude: nil, longitude: nil, vendor_id: nil> | |
# Supect rogue cache | |
# https://github.com/DFE-Digital/apply-for-teacher-training/blob/main/app/controllers/candidate_interface/course_choices/provider_selection_controller.rb#L8 | |
# https://github.com/DFE-Digital/apply-for-teacher-training/blob/main/app/forms/candidate_interface/continuous_applications/provider_selection_step.rb#L12 | |
(@provider_cache_key ||= "provider-list-#{Provider.maximum(:updated_at)}") if run_me |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
courses = RecruitmentCycle.current.providers.find_by(provider_code: "1KN").courses.where(course_code: ["3857", "H430", "3853", "384T", "384G", "38KK",]) | |
courses.update!(can_sponsor_student_visa: false) |
NewerOlder