- 
                Notifications
    
You must be signed in to change notification settings  - Fork 90
 
Implement easy import of schools from the ME #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.