Discussion:
[Erp5-dev] bug report: flaws in Person.setReference
Bartek Gorny
2010-03-18 10:28:21 UTC
Permalink
I found two flaws in setting a Person's reference, or login (unless
something has been changed very recently):

1. When login is being set, the code checks if another person with
this login exists and raises and exception; this exception is not
handled, so the user gets a raw, untranslated error message

2. The .setReference searches acl_users, where a user is created but
never removed. So, consider the following use case:

- I create a Person, give him a login "a_user" and make him a valid ERP5 user
- I try to create another user with the same login - it fails (and rightly so)
- I delete the old user
- I try again to create a new user with that login - and it fails too,
although the old user is already deleted (becaues the object still
exists, only in "deleted" state)

I think it is a bug. If a Person is deleted, one way or another, it
should free the reference; otherwise it becomes terribly confusing for
end-users.

Bartek
--
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"
Loading...