Univention Bugzilla – Bug 45163
[4.3] create custom django-admin command to seed School objects and check for superuser
Last modified: 2018-07-04 18:09:02 CEST
Instead of running in join script: echo "..." | ... manage.py shell
Writing custom django-admin commands: https://docs.djangoproject.com/en/1.10/howto/custom-management-commands/
Custom django-admin commands were created to improve the join script reliability. -------------------------------------------------------------------- /usr/share/pyshared/ucsschool/http_api/manage.py --help [..] [import_api] superuserexists updateschools /usr/share/pyshared/ucsschool/http_api/manage.py superuserexists --help /usr/share/pyshared/ucsschool/http_api/manage.py updateschools --help -------------------------------------------------------------------- # manage.py superuserexists xyz CommandError: User 'xyz' does not exist or is not a superuser. # echo $? 1 # manage.py superuserexists Administrator # echo $? 0 -------------------------------------------------------------------- # manage.py updateschools --ou xyz CommandError: Unknown school 'xyz'. # echo $? 1 # manage.py updateschools --ou SchuleEins Known schools now: 2576, SchuleEins, test2, test3, test4, test5, test6, test7, tx71qen12zw, wzs4y1txdfm. # echo $? 0 # manage.py updateschools --all Known schools now: 2576, SchuleEins, test2, test3, test4, test5, test6, test7, tx71qen12zw, wzs4y1txdfm. # echo $? 0 -------------------------------------------------------------------- [4.3] 5bb9e5d0 Bug #45163: create custom django-admin commands [4.3] 7c93d8da Bug #45163: changelog [4.3] f32db1a1 Bug #45163: advisory ucs-school-import (16.0.2-10)
Tested with 16.0.2-10A~4.3.0.201806121117 package installs OK new commands where executed and worked OK advisory OK changelog OK
UCS@school 4.3 v4 has been released. https://docs.software-univention.de/changelog-ucsschool-4.3v4-de.html If this error occurs again, please clone this bug.