Univention Bugzilla – Bug 35181
Traceback if class has been specified for staff import
Last modified: 2014-08-27 17:01:50 CEST
http://forum.univention.de/viewtopic.php?t=3347 During CSV import for staff users a traceback is shown if no header line has been specified or if a "class" column has been specified within the header line. The traceback happens during the CSV upload. Die Ausführung des Kommandos schoolcsvimport/save ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 591, in _response return function(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolcsvimport/__init__.py", line 140, in save_csv has_header = user_klass.is_header(first_line, dialect) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolcsvimport/util.py", line 139, in is_header found_column = cls.find_field_name_from_label(column, 0) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolcsvimport/util.py", line 153, in find_field_name_from_label attr = cls._attributes[name] KeyError: 'school_class' Looks like the code tries to set the "school_class" attribute for the staff user which is (on purpose!) not defined at the staff user object.
Fix: class CSVStaff(CSVUser, Staff): birthday = birthday_attr + + @classmethod + def find_all_fields(cls): + return ['name', 'firstname', 'lastname', 'birthday', 'email', 'password']
Ammar noticed that it is also impossible to specify a password while importing staff users. A traceback is returned. The traceback is reproducible via UMC.
(In reply to Sönke Schwardt-Krummrich from comment #2) > Ammar noticed that it is also impossible to specify a password while > importing staff users. A traceback is returned. The traceback is > reproducible via UMC. The traceback is the same as stated above. The CSV file did not contain a "class" column.
ucs-school-umc-csv-import 1.0.23-3
Traceback doesn't occur anymore. Class field is marked as unknown. Password field is regularly detected and applied to the user. Changelog: OK
UCS@school 3.2 R2 v2 has been released: http://docs.univention.de/release-notes-ucsschool-3.2R2v2-de.html If this error occurs again, please use "Clone This Bug".