Implement easy import of schools from the ME#248
Implement easy import of schools from the ME#248Igifigi wants to merge 1 commit intosio2project:masterfrom
Conversation
|
some more verbose commit messages might be useful (instead of "temp commit") |
As you can see, this PR is set as a draft, so commit names will be changed soon (probably tomorrow). |
2db4b84 to
fe33c00
Compare
|
@twalen now it's ready for review :)) |
|
|
fe33c00 to
168e6b8
Compare
eecc457 to
121a358
Compare
121a358 to
57dcebd
Compare
| update_school(curr_rspo_school, db_school) | ||
| rows_affected += 1 |
There was a problem hiding this comment.
Changes from MoE may introduce new duplicates.
| update_school(curr_rspo_school, db_school) | |
| rows_affected += 1 | |
| try: | |
| with transaction.atomic(): | |
| update_school(curr_rspo_school, db_school) | |
| rows_affected += 1 | |
| except utils.IntegrityError: | |
| self.log( | |
| f'Warning: Django found a duplicate school. Please manually check the school {db_school.rspo} data in SIO database, ' | |
| 'current RSPO and the last backup. Something suspicious may be going on.' | |
| ) |
|
The changes from this PR have been mostly incorporated here: 9e08444 – from what I’ve seen, only |
|
From our perspective legacy import is not needed. And since RSPO database is public, I think the command can be deleted |
Sure - I'll create a PR that removes the legacy import. |
This PR implements an algorithm that will bring order to school selection in SIO. Implemented script is used to import schools from the RSPO database, which is provided by the Ministry of Education and contains all educational institutions in Poland. Due to the poor quality of this data, it is likely that SIO administrators will modify school data. The task of this script is to detect which corrections from newer and more recent versions of the RSPO database should be accepted and applied, and which should not.