def f_src_id_by_proj_ver(proj, version):
for r in query_omw("""SELECT src.id
FROM src JOIN proj
ON src.proj_id=proj.id
WHERE proj.code= ? AND src.version = ?""",
[proj, version]):
return r['id']
Besides being confusing, it is a source of bugs. In one case (#48), the for loop iterated over an empty list, so the function returned None instead of r['id'].
For example:
Besides being confusing, it is a source of bugs. In one case (#48), the for loop iterated over an empty list, so the function returned
None
instead ofr['id']
.