Problem: User Import Reports "uid probably exists"

Problem

The importer does not import users due to “uid probably exists” instead of adding a counter to the user.

Environment

When user attributes change the importer re-creates the user with an added counter (ie foobar to foobar2). This happens only for users being created initially by the importer as the importer marks the users accordingly.
If a user now got created initially through a different way (ie UMC) instead of importer the importer can not add the counter as the user is not marked properly.

Solution

Mark the user to be imported by importer initally with the following code:

root@master:~# USERNAME=<USERNAME>
root@master:~# NEXTFREENUMBER=2
root@master:~# python -c "from ucsschool.importer.utils.username_handler import LdapStorageBackend; b = LdapStorageBackend('usernames'); b.create('${USERNAME}', ${NEXTFREENUMBER})"
Mastodon