csdl / makahiki

An Open Source "Serious Game" Framework for Sustainability
http://makahiki.readthedocs.org/
MIT License
7 stars 5 forks source link

New users cannot be created individually in Settings #584

Closed jtakayama closed 10 years ago

jtakayama commented 10 years ago

Administrators cannot create new users one at a time in Settings. Bulk uploads still work.

To reproduce this bug in a default Makahiki instance with MAKAHIKI_DEBUG=True:

  1. Log in as an administrator
  2. Create a new user: 2a. Username can be any valid string with no uppercase letters, e.g., "tester." 2b. Password can be any valid password (e.g., "tester").
  3. The Lehua-A team was used.

After saving the new user, the system will raise an IntegrityError:

duplicate key value violates unique constraint "player_mgr_profile_user_id_key"
DETAIL:  Key (user_id)=(6) already exists.

If the administrator tries to create more users, each user will have the user_id number in the IntegrityError incremented by one. The next user in this example would have the error "Key (user_id)=(7) already exists," and so on.

jtakayama commented 10 years ago

A second database reset fixed the problem. I have not identified what caused the error the first time

EDIT: I was able to reproduce the error on the Vagrant virtual machine after the database reset. The error occurs only if information is filled in under "Profiles" on the user creation screen. If no "Profiles" information is filled in, user creation succeeds.

single_user_creation

yongwen commented 10 years ago

override the default admin template to hide the inline profile form.