Univention Bugzilla – Bug 52973
updateschools.py is missing a --rm $OU option
Last modified: 2023-06-23 13:36:05 CEST
In the school_creation.py listener I'd also like to react to removal of schools by deleting it from the http_api database. For this a --rm option would be needed. The file for this is ucs-school-import/modules/ucsschool/http_api/import_api/management/commands/updateschools.py. The school could be removed with a call to School.objects.get(name=name).delete(). Testing could look like this: with UcsSchoolTest..() as schoolenv: neueou = schoolenv.create_ou(cache=False) # post-create-hook should have added OU to DB assert neueou in Popen("manage.py shell -c 'print(School.objects.all())'") # post-delete-hook should have removed OU from DB assert neueou not in Popen("manage.py shell -c 'print(School.objects.all())'")