Univention Bugzilla – Bug 41572
move python hook code into ImportUser class
Last modified: 2016-10-06 11:51:16 CEST
Currently the hooks are called from UserImport. That is fine as long as the Users are used within during an import job. But ImportUser should be usable solo like User. Move python hook code into ImportUser class.
PyHooks are now part of the ImportUser class and are run from class_hooks() like in the lib.User class. ImportStudent(name="a", firstname="a", lastname="a", school="schule1").create(lo) → PyHook pre_create → lib.hook pre_create → create_without_hooks() → PyHook post_create → lib.hook post_create The order could be changed to look more symmetric, but I don't know of any reason... code: 70858 advisory: 70859
PS: "import os": 70860 / 70861
Caching of PyHooks didn't work in the case of "no pyhooks". As a result a search for pyhooks was made for every new ImportUser object. Fixed in r71191.
90_ucsschool.34_import-users_via_cli was failing, because LegacyImportUser.input_data was empty after A and M and thus the ucsschool.lib post-hooks couldn't work. Fixed in r71199.
Moving of the PyHooks code to the lib User class was delayed until later, so this R2 be released. Moving code from ImportUser to User shouldn't be to problematic.
OK: changes
r72665: added 90_ucsschool/112_import_user_pyhooks to test modifications on user objects by python import hooks
UCS@school 4.1 R2 v5 has been released. http://docs.software-univention.de/changelog-ucsschool-4.1R2v5-de.html If this error occurs again, please clone this bug.
*** Bug 41576 has been marked as a duplicate of this bug. ***