We just noticed that the pre_modify() hooks are called upon user deletion with deletion_grace_time. I assumed the pre/post_delete hooks to be called. We should create a flow chart, when which hook is/should be called and then fix the code accordingly.
In case we would want to change this. It'd be done with this commit in branch dtroeder/45715_4.3_checks_in_dry-run: [dtroeder/45715_4.3_checks_in_dry-run] 7ffc2ec8 Bug #47183: run remove hooks when deleting with grace, instead of modify hooks One line (changing the signature of modify()) slipped though into commit: [dtroeder/45715_4.3_checks_in_dry-run] 852bad00 Bug #45715: use admin connection in a real run, use machine connection during a dry-run
The remove hooks will be executed when the user is deleted by /usr/share/ucs-school-import/scripts/ucs-school-purge-expired-users. The currently executed modify hooks (when deactivating a user) can be used to detect this, by looking at udm_obj["ucsschoolPurgeTimestamp"] or ImportUser.has_purge_timestamp(). The relevant code in dtroeder/45715_4.3_checks_in_dry-run has been reverted: [dtroeder/45715_4.3_checks_in_dry-run b7ac99773] Bug #47183: don't change hooks in case of scheduled_for_deletion, don't change signature of modify()
Yes, as discussed, the current behaviour is the correct one. The commit has been reverted. → VERIFIED
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.