Univention Bugzilla – Bug 52039
Exam cannot be finished if displayname contains brackets
Last modified: 2022-01-19 23:59:14 CET
When finishing the exam the error message below appears. The exam cannot be finished. ---------------------------------------------------- Ein Fehler ist aufgetreten: Die Anfrage konnte nicht bearbeitet werden. Interner Server-Fehler in "computerroom/exam/finish". Interner Server-Fehler in "computerroom/exam/finish". Request: computerroom/exam/finish Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 359, in __error_handling six.reraise(etype, exc, etraceback) File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 262, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/__init__.py", line 188, in _decorated return func(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response result = _multi_response(self, request) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response return list(function(self, iterator, *nones)) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/__init__.py", line 702, in finish_exam self._settings_set(printMode='default', internetRule='none', shareMode='all', customRule='') File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/__init__.py", line 188, in _decorated return func(self, *args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/__init__.py", line 761, in _settings_set self.reset_smb_connections() File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/__init__.py", line 886, in reset_smb_connections italc_users = [x.lower() for x in self._italc.users if x] File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/italc2.py", line 672, in users return [_usermap[x.user.current].username for x in self.values() if x.user.current and x.connected()] File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/italc2.py", line 101, in __getitem__ self._read_user(user) File "/usr/lib/pymodules/python2.7/ucsschool/lib/school_umc_ldap_connection.py", line 123, in wrapper_func return func(*args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/computerroom/italc2.py", line 108, in _read_user raise AttributeError('invalid key "%s"' % userstr) AttributeError: invalid key "lara.croft (Croft Lara (lara.croft))" ------------------------------------------- Expected behaviour would be, that it is not possible to set a displayname with brackets or this is no problem at all.
univention-app info: master: UCS: 4.4-5 errata737 Installed: pkgdb=11.0 samba4=4.10 ucsschool=4.4 v6 Upgradable: schulserver: UCS: 4.4-5 errata737 Installed: cups=2.2.1 dhcp-server=12.0 samba4=4.10 squid=3.5 ucsschool=4.4 v6 Upgradable:
I could reproduce the error with lara.croft (Croft Lara (lara.croft)) by stopping an exam with the said user, italc must be installed on the client computer. Fixed in twenzel/52039_displayname_with_brackets [twenzel/52039_displayname_with_brackets] b27e91c27 Bug #52039: add unittest [twenzel/52039_displayname_with_brackets] 332ea555d Bug #52039: italc allow brackets in displayname by changing the regex & adding a unit-test. Remark: The changelog date is not strictly increasing, this has to be adjusted before building and after the merge to 4.4
Fix: OK Unittest: Please check https://hutten.knut.univention.de/mediawiki/index.php/Unittests/univention-management-console-module-lib on where and how to add unittests to packages. Also the test username_missing fails on my machine.
I moved the test to the ucs-school-umc-computerroom module & fixed the missing test. My regex wasn't correct, so i fixed that too. [twenzel/52039_displayname_with_brackets] 5b0d1b079 fixup! Bug #52039: add unittest [twenzel/52039_displayname_with_brackets] f7a2f4f6d fixup! Bug #52039: italc allow brackets in displayname [twenzel/52039_displayname_with_brackets] 115bb4dfa fixup! Bug #52039: italc allow brackets in displayname [twenzel/52039_displayname_with_brackets] 1e4451bb2 fixup! Bug #52039: add unittest
Leave RESOLVED, verify if jenkins is happy. As discussed, we leave the unittest in ucs-test-ucsschool for now. I merged to 4.4 with [4.4] 0a7e7d623 Bug #52039: yaml version [4.4] 19fa16838 Bug #52039: correct yaml [4.4] 1b0f7744f Bug #52039: changelogs and yaml [4.4] 9352eba8e Bug #52039: add unittest [4.4] 44dec8633 Bug #52039: italc allow brackets in displayname Package: ucs-school-umc-computerroom Version: 11.0.0-21A~4.4.0.202009291100 Branch: ucs_4.4-0 Scope: ucs-school-4.4 Package: ucs-test-ucsschool Version: 6.0.142A~4.4.0.202009291103 Branch: ucs_4.4-0 Scope: ucs-school-4.4
Changelog&Advisory: OK Package installs: OK Tests: OK Manual tests with italc installation: OK
UCS@school 4.4 v7 has been released. https://docs.software-univention.de/changelog-ucsschool-4.4v7-de.html If this error occurs again, please clone this bug.
*** Bug 42424 has been marked as a duplicate of this bug. ***