Bug 52039 - Exam cannot be finished if displayname contains brackets
Exam cannot be finished if displayname contains brackets
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v7
Assigned To: Tobias Wenzel
Ole Schwiegert
:
: 42424 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-09-16 11:28 CEST by Christina Scheinig
Modified: 2022-01-19 23:59 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.114
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2020090921000515
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2020-09-16 11:28:42 CEST
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.
Comment 1 Christina Scheinig univentionstaff 2020-09-16 12:21:36 CEST
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:
Comment 2 Tobias Wenzel univentionstaff 2020-09-25 14:33:52 CEST
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
Comment 3 Ole Schwiegert univentionstaff 2020-09-28 09:18:17 CEST
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.
Comment 4 Tobias Wenzel univentionstaff 2020-09-28 14:25:54 CEST
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
Comment 5 Tobias Wenzel univentionstaff 2020-09-29 11:06:30 CEST
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
Comment 6 Ole Schwiegert univentionstaff 2020-10-02 09:27:25 CEST
Changelog&Advisory: OK
Package installs: OK
Tests: OK
Manual tests with italc installation: OK
Comment 7 Daniel Tröder univentionstaff 2020-10-12 16:18:58 CEST
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.
Comment 8 Jürn Brodersen univentionstaff 2022-01-19 23:59:14 CET
*** Bug 42424 has been marked as a duplicate of this bug. ***