Defect #1781
Error deleting Users
Status: | Closed | Start date: | 2008-08-13 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Accounts / authentication | |||
Target version: | 0.8 | |||
Resolution: | Fixed | Affected version: | 0.7.3 |
Description
Although Redmine doesn't provide a User deletion feature I think this should not prevent destroy
method to crash.
Destroying a user instance causes the following error:
>> User.find_by_login('user').destroy ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'projects.status' in 'where clause': DELETE FROM `members` WHERE ((user_id = 5) AND (projects.status=1)) from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in `execute' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `update_sql' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:296:in `update_sql' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:167:in `delete_sql' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete_without_query_dirty' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `delete' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:715:in `delete_all' from (eval):1:in `configure_dependency_for_has_many' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:311:in `call' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:311:in `callback' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:304:in `each' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:304:in `callback' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:294:in `destroy_without_transactions' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy' from (irb):3>
Associated revisions
Fixed: invalid SQL query on User#destroy (#1781).
History
#1
Updated by Jean-Philippe Lang over 14 years ago
- Category set to Accounts / authentication
- Status changed from New to Closed
- Target version set to 0.8
- Resolution set to Fixed
Fixed in r1755. But as you mentioned, user deletion is not supported and should not be done.