Bug 51190 - The import crashes if the name of a class contains a backslash
The import crashes if the name of a class contains a backslash
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
unspecified
Other Mac OS X 10.1
: P5 normal (vote)
: UCS@school 4.4 v5-errata
Assigned To: Toni Röhmeyer
Tobias Wenzel
:
Depends on: 45683
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-30 08:41 CEST by Daniel Tröder
Modified: 2020-06-10 14:36 CEST (History)
1 user (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?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
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 Daniel Tröder univentionstaff 2020-04-30 08:41:11 CEST
+++ This bug was initially created as a clone of Bug #45683 +++

This change doesn't make sense to me:

---------------------------------------------------------------
diff --git a/ucs-school-lib/python/models/user.py b/ucs-school-lib/python/models/user.py
index 8b5fffbfd943e27c86029b94882d4fc8a66a7ea9..174b0c64ce75b2b3f7cc42ba5c7f9ed870a46ab8 100644
--- a/ucs-school-lib/python/models/user.py
+++ b/ucs-school-lib/python/models/user.py
@@ -424,7 +424,7 @@ class User(RoleSupportMixin, UCSSchoolHelperAbstractClass):
 				try:
 					syntax.gid.parse(class_name)
 				except valueError as exc:
-					self.add_error('school_classes', str(exc))
+					self.add_error('school_classes', _('{}'.format(exc)))
 
 	def remove_from_school(self, school, lo):
 		if not self.exists(lo):
---------------------------------------------------------------

1. There can be no translation for arbitrary strings (unknown error message).
2. We don't translate error messages for log files, only for UMC-Exceptions.

Please revert the code or explain its intentions.
Comment 1 Daniel Tröder univentionstaff 2020-04-30 09:25:30 CEST
Arg!
This commit (6338822a3452153add08e168def947de6c233fc0) did break the import!
it removed the Python import of "string"!
Comment 2 Toni Röhmeyer univentionstaff 2020-04-30 11:40:17 CEST
Issue resolved with commit

commit 661b733fa3bd61019b40cb619966cd72576e6507
Bug #51190: added import string

on branch 4.4


Successful build:

Package: ucs-school-import
Version: 17.0.34A~4.4.0.202004301134
Branch: ucs_4.4-0
Scope: ucs-school-4.4


Sorry, this will not happen again.
Comment 3 Tobias Wenzel univentionstaff 2020-04-30 11:56:00 CEST
No problem. 
Please also apply the changes in the Bug description.
Comment 4 Toni Röhmeyer univentionstaff 2020-04-30 13:02:58 CEST
Issue in Bug description resolved with 

commit baf3941df2f8b19c3ca97cfa5fde9ee589fc7596
Bug #51190: added yaml

commit cd3ab6d3da23bb5c8153f3b24473ebc852d00ebb
Bug #51190: added changelog entry

commit e42348c10462edddcf35b4df12d6e15d347e85b5
Bug #51190: revert minor changes

on branch 4.4.


Successful build:

Package: ucs-school-lib
Version: 12.1.13A~4.4.0.202004301222
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 5 Tobias Wenzel univentionstaff 2020-04-30 15:27:15 CEST
Thanks for the adjustments!

Code -> ok
Changelog -> ok
Yaml -> ok
Comment 6 Ole Schwiegert univentionstaff 2020-06-10 14:36:40 CEST
UCS@school 4.4 v5 has been released (errata update to the release).

https://docs.software-univention.de/changelog-ucsschool-4.4v5-de.html

If this error occurs again, please clone this bug.