base_calendar, caldav: revise SQL calls.

bzr revid: p_christ@hol.gr-20101012103723-alnh7rkf1g8tthlo
This commit is contained in:
P. Christeas
2010-10-12 13:37:23 +03:00
parent 50bad302ad
commit eeffc06f2a
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1065,7 +1065,7 @@ class calendar_event(osv.osv):
'rule_type': rrule_type,
'id': id,
})
cr.execute(qry % val)
cr.execute(qry, val) # Hopefully psycopg2 works with dicts. But, FIXME
return True
def _get_rulestring(self, cr, uid, ids, name, arg, context=None):
@@ -1682,7 +1682,7 @@ class calendar_todo(osv.osv):
@param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...].
@param context: A standard dictionary for contextual values
"""
assert name == 'date'
return self.write(cr, uid, id, { 'date_start': value }, context=context)
+2 -2
View File
@@ -63,8 +63,8 @@ def uid2openobjectid(cr, uidval, oomodel, rdate):
return (False, None)
qry = 'SELECT DISTINCT(id) FROM %s' % model_obj._table
if rdate:
qry += " where recurrent_id='%s'" % (rdate) #TOFIX: sql injection
cr.execute(qry)
qry += " WHERE recurrent_id=%s"
cr.execute(qry, (rdate,))
r_id = cr.fetchone()
if r_id:
return (id, r_id[0])