Univention Bugzilla – Bug 42472
ucs-school-import: ignore [VARIABLE] in input of other properties when formatting unique usernames
Last modified: 2023-06-12 15:39:44 CEST
This is split of Bug #42313 comment17. ----------------------------------------------- When I add a lastname of test[ALWAYSCOUNTER] I get this traceback: u'scheme': {u'email': u'<firstname>[0].<lastname>@<maildomain>', u'recordUID': u'<email>', u'username': {u'allow_rename': False, u'default': u'<:umlauts><firstname>[0].<lastname><:lower>[COUNTER2]'}}, Shouldn't the value be escaped? Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 106, in create_and_modify_users user = self.determine_add_modify_action(imported_user) File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 195, in determine_add_modify_action imported_user.prepare_all(new_user=True) File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 227, in prepare_all self.prepare_attributes(new_user) File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 240, in prepare_attributes self.make_username() File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 483, in make_username self.name = self.username_handler.format_username(self.name) File "/usr/lib/pymodules/python2.7/ucsschool/importer/utils/username_handler.py", line 125, in format_username raise FormatError("More than one counter variable found in username scheme '{}'.".format(name), name, name) FormatError: More than one counter variable found in username scheme '.test[alwayscounter][counter2]'. ------------------------------------------------------------ [VAR] in other properties input data (eg <lastname>) should be ignored. Currently username_handler doesn't know anything about that, as it gets just a string passed that has already been formatted by the replacement code from UDMs users:templates.
*** This bug has been marked as a duplicate of bug 42478 ***
This is not a duplicate. This bug wants to close a single, very theoretical problem of otherwise well working and very well tested code. Motivated by problems that are mostly already fixed, the other bug wants to replace the code with a complete rewrite. This bug could be closed however, if the rewrite would be implemented.
This issue has been filled against UCS@school 4.1 (R2). The maintenance with bug and security fixes for UCS@school 4.1 (R2) has ended on 5th of April 2018. Customers still on UCS 4.1 are encouraged to update to UCS 4.3 (or later). Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.