c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #01273
[Bug 666857] Re: [6.0] fetchmail module check_duplicate code sql query is wrong
Hello Niels,
Yes it has been already fixed by revision 4430
ach@xxxxxxxxxxx-20101019101833-0fez00fq3ygkdklt
Thanks.
** Changed in: openobject-addons
Status: New => Fix Released
** Changed in: openobject-addons
Milestone: None => 6.0-rc2
** Changed in: openobject-addons
Assignee: (unassigned) => Anup (OpenERP) (ach-openerp)
--
[6.0] fetchmail module check_duplicate code sql query is wrong
https://bugs.launchpad.net/bugs/666857
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Addons Modules: Fix Released
Bug description:
RC1
fetchmail/fetchmail.py:73
The code is
cr.execute("select count(id) from email_server where user='%s' and password='%s'", (vals['user'], vals['password']))
Should've been
cr.execute("select count(id) from email_server where user=%s and password=%s", (vals['user'], vals['password']))
Or even better (as the RFC comments) use the sql constraints with a combined unique key
Like
_sql_constraints = [
('unique_account', 'UNIQUE(user,password)', 'Warning! Can\'t have duplicate server configuration!')
]
References