Univention Bugzilla – Bug 47073
[4.2] The user role should be configurable in the CSV file
Last modified: 2018-07-04 18:07:55 CEST
Merge to UCS@school 4.2. +++ This bug was initially created as a clone of Bug #42416 +++ Currently the user role can only be defined in the CSV file if using the: ucsschool.importer.reader.test_csv_reader.TestCsvReader With a mapping of to a private property: "Benutzertyp": "__type", This should be easier!
New user role assignment can now be handled by the regular CSV reader class CsvReader. This allows the use of the special mapping value "__role". Allowed values in the CSV column are student, staff, teacher and teacher_and_staff. The use of the TestCsvReader class is no longer required. For backwards compatibility the class still exists and allows to use "__type". [4.2] 58e4b029 Bug #47073: move handling of special mapping value for user role to regular CsvReader [4.2] aca07bc5 Bug #47073: adapt tests to use the new special mapping value in the regular CsvReader [4.2] 12c08953 Bug #47073: changelog [4.2] 6d10cc82 Bug #47073: advisory ucs-school-import (15.0.3-39) ucs-test-ucsschool (4.0.4-89)
http://jenkins.knut.univention.de:8080/job/UCSschool%204.2/job/Manual/170/artifact/webroot/ucsschool-import-handbuch-4.2.pdf
changelog OK Advisory OK Documentation OK Import with __role mapping OK Import wit __role and --user_role REOP When you import a csv with a __role mapping but also use the --user_role option the import crashes with a noObject exception if there is at least one row in the CSV that does not have the role specified in the command line parameter. This is because the created object got the role specified in the CSV but was expected to have the role specified in --user_role. The documentation states that the command line parameter should not be used if a __role attribute is present but the import should not just crash. In my opinion there should also be a clear rule for what option gets priority. I added the csv and the resulting log as attachements to the bug. The command used was: /usr/share/ucs-school-import/scripts/ucs-school-user-import --conffile /var/lib/ucs-school-import/configs/user_import.json --infile test.csv --school AE For the files please check Bug #42416
I forgot to add a remark about the documentation: In line 984 of ucsschool-import-handbuch-4.2.xml: Der Inhalt dieser Spalte wird ignoriert. Die kann z.B. verwendet werden, wenn die CSV-Datei leerer Spalten, oder solche mit nicht zu importierenden Daten, enthält. What does 'Die' refer to. The Sonderwerte from the beginning of the chapter? I guess it should be 'leere Spalten' This sentence is a bit hard to grasp in my opinion because of the "Die" and since it was already edited here it might be fixed here as well.
Reasoning see Bug #42416 comment11. [4.2] b5068016a Bug #47073: prevent running forbidden configuration combination [4.2] 56d17f156 Bug #47073: changelog [4.2] 379e52beb Bug #47073: advisory update ucs-school-import (15.0.3-60)
changelog OK Advisory OK Documentation OK Import with __role mapping OK Import wit __role and --user_role OK
UCS@school 4.2 v10 has been released. https://docs.software-univention.de/changelog-ucsschool-4.2v10-de.html If this error occurs again, please clone this bug.