From 87595d6a74e7efd8a9a709d1e3c0ec0811b7c81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 31 Jul 2011 17:13:46 +0200 Subject: [PATCH] Fix rowcount usage review68001 (transplanted from 14c066caee18aec33bf9710324aefe4559433b20) --- forecast.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forecast.py b/forecast.py index 0eaad0c3da..698162fe49 100644 --- a/forecast.py +++ b/forecast.py @@ -106,7 +106,10 @@ class Forecast(ModelWorkflow, ModelSQL, ModelView): forecast.from_date, forecast.to_date, forecast.location.id, forecast.destination.id, forecast.id)) - if cursor.rowcount: + rowcount = cursor.rowcount + if rowcount == -1 or rowcount is None: + rowcount = len(cursor.fetchall()) + if rowcount: return False return True