Project

General

Profile

Creating new users programmatically

Added by Tundra Slosek over 15 years ago

I've tried creating new users by talking to the database directly with the following two SQL statements:

INSERT into users (login, hashed_password, firstname, lastname, mail, mail_notification, admin, status, language) values (blahblahblah)

followed by

INSERT into members (user_id, project_id, role_id) values (blahblahblah)

Everything works fine with one exception:

When creating a new issue, the users created with the above are presented as checkboxes under 'watchers' (along with all the other users), but if they are selected, I get

« Watcher users » is invalid

And the issue won't be created. After the issue is created (without those users), I can add the users created as above individually as watchers without a problem.