Univention Bugzilla – Bug 52719
Javascript widget should check exam name | ValueError: Das angegebene Projektverzeichnis darf nicht mit einem "." beginnen oder enden.
Last modified: 2022-08-04 18:35:50 CEST
Version: 4.4-4 errata648 (Blumenthal) - UCS@school 4.4 v5 Remark: Fehler beim Speichern einer Klassenarbeit Error: Interner Server-Fehler in "schoolexam/exam/add". Request: schoolexam/exam/add Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 359, in __error_handling six.reraise(etype, exc, etraceback) File "%PY2.7%/univention/management/console/base.py", line 262, in execute function.__func__(self, request, *args, **kwargs) File "%PY2.7%/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "%PY2.7%/univention/management/console/modules/schoolexam/__init__.py", line 369, in add self._save_exam(request) File "%PY2.7%/ucsschool/lib/school_umc_ldap_connection.py", line 123, in wrapper_func return func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/schoolexam/__init__.py", line 290, in _save_exam project.validate() File "%PY2.7%/univention/management/console/modules/distribution/util.py", line 375, in validate raise ValueError(_('The specified project directory may not start nor end with a ".".')) ValueError: Das angegebene Projektverzeichnis darf nicht mit einem "." beginnen oder enden. Role: domaincontroller_slave
I guess this should be checked by the JavaScript widget, to prevent users from ever seeing this error.
Another Customer is asking for this.
(In reply to Daniel Tröder from comment #1) > I guess this should be checked by the JavaScript widget, to prevent users > from ever seeing this error. well, but it should also be handled in the backend. The error is already handled in the project distribution module but not in the schoolexam module: ucs-school-umc-distribution/umc/python/distribution/__init__.py 273 » » » # initiate project and validate its values 274 » » » try: 275 » » » » project.validate() 276 » » » except ValueError as exc: 277 » » » » raise UMC_Error(str(exc)) Best would be if the exam module would also handle that exception and gives that error message back into the javascript form.
I concur: it should be checked at exam creation time in both the frontend and the backend.
https://git.knut.univention.de/univention/ucsschool/-/merge_requests/123 The proposed merge request introduces the following changes: The front-end recognizes now all invalid exam directory names. On SAVE EXAM any incorrect exam directory name will be detected by the backend (for the 5.0 branch, this already worked except for cases like ".." and "."). The tool-tip for the validation textbox includes that spaces or "." are not allowed at the start or end of the name.
OK: Invalid directory name detected on SAVE and START OK: yaml -> can be merged and built
(merge after release) Changed target milestone to 5.0 v2 errata.
Merged with 2e8eab11: * The front-end recognizes now all invalid exam directory names * Any incorrect exam directory name will be detected by the backend and an appropriate error message is shown * The tool-tip for the validation textbox includes that spaces or "." are not allowed at the start or end of the name
UCS@school 5.0 v3 has been released. https://docs.software-univention.de/changelog-ucsschool-5.0v3-de.html If this error occurs again, please clone this bug.