Administrator cannot delete a user.
Bug #742208 reported by
Fumito Mizuno
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Sahana-Eden |
Fix Released
|
Medium
|
Fran Boon |
Bug Description
I tried to delete a user.
1. I clicked User Management -> Users in eden/admin/index.
2. I clicked "Delete" of a user.
3. The message "Integrity error: record can not be deleted while it is referenced by other records" is displayed.
I tried in japan.sahanafou
In older version, r1583 (2010-12-20 12:21:42), I tested and I can delete a user.
Changed in sahana-eden: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This is the PostgreSQL error log: owned_by_ user_fkey" on table "pr_person"
ERROR: update or delete on table "auth_user" violates foreign key constraint "pr_person_
DETAIL: Key (id)=(84) is still referenced from table "pr_person".
So the issue is that whenever an auth_user account is registered, we create an associated pr_person account & set the pr_person record to be owned by this auth_user (so a login can always modify their own record).
Options that we have for deleting auth_user accounts:
* Delete the associated pr_person record
* Blank the owned_by field in the associated pr_person account
- although this will only be easy for the pr_person, not for all the other records this user has created.
* Prompt user to choose between these 2 options
* Do a 'soft' delete of the user (i.e. add the 'deleted' field to the auth_user table, the framework should take care of the rest)
* Never delete a user account but only Disable
- in which case we should replace the 'Delete' Action button with one which says 'Disable'
I would choose one of the last 2 options.
In fact even if we make accounts soft deletable, I think perhaps replacing the 'Delete' Action button with a 'Disable' one is best.
Thoughts?