Bug 42472 - ucs-school-import: ignore [VARIABLE] in input of other properties when formatting unique usernames
ucs-school-import: ignore [VARIABLE] in input of other properties when format...
Status: CLOSED WONTFIX
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.1 R2
Other Linux
: P5 enhancement (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-22 13:13 CEST by Daniel Tröder
Modified: 2023-06-12 15:39 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.006
Enterprise Customer affected?:
School Customer affected?: Yes
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 2016-09-22 13:13:48 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.
Comment 1 Florian Best univentionstaff 2016-10-19 15:44:17 CEST

*** This bug has been marked as a duplicate of bug 42478 ***
Comment 2 Daniel Tröder univentionstaff 2016-10-20 20:02:40 CEST
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.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2019-02-05 21:43:52 CET
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.