Univention Bugzilla – Bug 44537
(4.2) Removing users causes displaying of error message
Last modified: 2017-09-07 16:49:57 CEST
The changes caused a regression when removing non-school-overlapping users: The UMC always shows "Konnte den Benutzer nicht aus der Schule entfernen." because remove_from_school() removes the user already (because she is only part of one school) and the newly added modify() call will therefore fail: svn r76772 +» » » if success: +» » » » success = obj.modify(ldap_user_write) So the user gets successfully removed but there will always be an error message that it failed. +++ This bug was initially created as a clone of Bug #43170 +++ If a user which is located under schoolA and should be removed from schoolA a error message in UMC pops up "Failed to remove user from school.". The logfile contains: Student(name='elsabe', school='schoolA', dn='uid=elsabe,cn=schueler,cn=users,ou=schoolA,dc=school,dc=local') wants to move to its own DN! The reason is that the UMC-frontend sends a request ala: {$dn$: dn, school: 'schoolA'} And the code does the following: ucs-school-umc-wizards/umc/python/schoolwizards/__init__.py 104 » » if require_dn: 105 » » » try: 106 » » » » obj = klass.from_dn(dn, obj_props.get('school'), lo) 107 » » » except noObject: 108 » » » » raise UMC_Error(_('The %s %r does not exists or might have been removed in the meanwhile.') % (getattr(klass, 'type_name', klass.__name__), obj_props['name'])) 109 » » » for key, value in obj_props.iteritems(): 110 » » » » if key in obj._attributes: 111 » » » » » setattr(obj, key, value) → So it sets every value of the request i.e. obj.school = 'schoolA' In ucs-school-lib/python/models/user.py remove_from_school() then the following if-case is wrong: 398 » » if self.school == school: 399 » » » if not self.change_school(self.schools[0], lo):
Hmm, not so easy to fix. The changes also depend on Bug #41910 (svn r76682). the remove_from_school() function since then does sometimes a modification and sometimes not, depending on the primary/secondary school.
ucs-school-umc-wizards (9.0.4-5): r79377 | Bug #44537: fix removal of users ucs-school-umc-wizards.yaml: r79378 | YAML Bug #44537
When I remove a student that is in 1 school in the UMC, I get this error window: -------------------------------------------------- 1 error(s) occurred: 0 object remove_from_school: Argument required -------------------------------------------------- Nothing is logged to management-console-module-schoolwizards.log, but in management-console-web-server.log there is: -------------------------------------------------- 17.05.17 12:20:09.914 MAIN ( PROCESS ) : CPCommand (10.205.1.238:32862) response status code: 422 17.05.17 12:20:09.914 MAIN ( PROCESS ) : CPCommand (10.205.1.238:32862) response message: 1 error(s) occurred 17.05.17 12:20:09.914 MAIN ( PROCESS ) : CPCommand (10.205.1.238:32862) response result: {'0': {'object': {'remove_from_school': 'Argument required'}}} --------------------------------------------------
It's only a caching issue in UCS 4.2. After 1 day the cache is reset. Therefore not a real problem. The UCS 4.1 bug is not affected.
OK: manual test OK: automated test r79426: extended test to check removal of single, primary and secondary schools from User
UCS@school 4.2 v2 has been released. http://docs.software-univention.de/changelog-ucsschool-4.2v2-de.html If this error occurs again, please clone this bug.