← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 666857] Re: [6.0] fetchmail module check_duplicate code sql query is wrong

 

Ah I see revision 4430 has fixed the quote problem.

Still I would propose to make it use _sql_constraints instead !

-- 
[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: New

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