﻿ticket,summary,type,release,owner,status,created,modified,_description,_reporter
10056,Removing users without group,defect,0.12,Dolf Andringa,new,2012-05-30T09:51:11+02:00,2012-05-30T09:51:11+02:00,"Removing users without group removes additional info like name or email, but not the users.

When I've changed the sql_delete_user_query (52 line in sqlflexibleauthstore.py) from
{{{
sql_delete_user_query = Option('account-manager','sql_delete_user_query',""DELETE users.*,membership.* FROM users,membership WHERE membership.userid=users.userid AND users.$username_field$='$username$'"",
}}}
to
{{{
sql_delete_user_query = Option('account-manager','sql_delete_user_query',""DELETE u,m FROM users AS u LEFT JOIN membership AS m ON m.userid=u.userid WHERE u.$username_field$='$username$'"",
}}}
it worked",czarnymb
10057,"IntegrityError: (1062, ""Duplicate entry 'name' for key 'username'"")",defect,0.12,Dolf Andringa,new,2012-05-30T09:57:20+02:00,2013-05-14T02:23:47+02:00,"==== How to Reproduce ====

While doing a POST operation on `/prefs/account`, Trac issued an internal error.

''Additional details'' -- Password Changing in Profile Preferences

Request parameters:
{{{
{'__FORM_TOKEN': u'e39d7abe2c3679c7df5e4841',
 'action': u'save',
 'old_password': u'marek',
 'panel_id': u'account',
 'password': u'test',
 'password_confirm': u'test'}
}}}

User agent: `Opera/9.80 (Windows NT 5.1; U; pl) Presto/2.10.229 Version/11.64`

==== Python Traceback ====
{{{
Traceback (most recent call last):
  File ""build\bdist.win32\egg\trac\web\main.py"", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File ""build\bdist.win32\egg\trac\web\main.py"", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File ""build\bdist.win32\egg\trac\prefs\web_ui.py"", line 77, in process_request
    template, data = chosen_provider.render_preference_panel(req, panel_id)
  File ""build\bdist.win32\egg\acct_mgr\web_ui.py"", line 225, in render_preference_panel
    data = {'account': self._do_account(req),
  File ""build\bdist.win32\egg\acct_mgr\web_ui.py"", line 287, in _do_account
    data.update(self._do_change_password(req))
  File ""build\bdist.win32\egg\acct_mgr\web_ui.py"", line 357, in _do_change_password
    self.acctmgr.set_password(user, password, old_password)
  File ""build\bdist.win32\egg\acct_mgr\api.py"", line 295, in set_password
    self._notify('password_changed', user, password)
  File ""build\bdist.win32\egg\acct_mgr\api.py"", line 456, in _notify
    getattr(l, func)(*args)
  File ""C:\Program Files\BitNami Trac Stack\python\lib\site-packages\sqlflexibleauthstoreplugin-0.1-py2.6.egg\sqlflexibleauthstore\sqlflexibleauthstore.py"", line 299, in user_password_changed
    return self.set_password(user,password,create_user=True)
  File ""C:\Program Files\BitNami Trac Stack\python\lib\site-packages\sqlflexibleauthstoreplugin-0.1-py2.6.egg\sqlflexibleauthstore\sqlflexibleauthstore.py"", line 205, in set_password
    cursor.execute(query)
  File ""build\bdist.win32\egg\trac\db\util.py"", line 66, in execute
    return self.cursor.execute(sql)
  File ""C:\Program Files\BitNami Trac Stack\python\lib\site-packages\MySQLdb\cursors.py"", line 173, in execute
    self.errorhandler(self, exc, value)
  File ""C:\Program Files\BitNami Trac Stack\python\lib\site-packages\MySQLdb\connections.py"", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
IntegrityError: (1062, ""Duplicate entry 'name' for key 'username'"")
}}}",czarnymb
