Univention Bugzilla – Bug 44588
U@S 4.1: Removing users causes displaying of error message
Last modified: 2017-06-23 13:33:13 CEST
Please also fix this issue for U@S 4.2. +++ This bug was initially created as a clone of Bug #44537 +++ 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):
ucs-school-umc-wizards (8.0.1-3): r79380 | Bug #44588: fix removal of users ucs-school-umc-wizards.yaml: r79381 | YAML Bug #44588
Please clearly mark API changes in the future. OK: code OK: advisory OK: manual test OK: automatic test (QA adapted test-suite to API change and extended a test: r79430)
UCS@school 4.1 R2 v12 has been released. http://docs.software-univention.de/changelog-ucsschool-4.1R2v12-de.html If this error occurs again, please clone this bug.