From 6fc10f50b0c9b877fffcad4893056cb91fa66b4f Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 10 Jun 2007 01:52:56 +0000 Subject: [PATCH] Fixed #4518 -- Added handling of empty strings in typecast_decimal() for SQLite's benefit. Thanks, Richard House. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5450 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/util.py b/django/db/backends/util.py index 18f120b600..81c752e664 100644 --- a/django/db/backends/util.py +++ b/django/db/backends/util.py @@ -91,7 +91,7 @@ def typecast_boolean(s): return str(s)[0].lower() == 't' def typecast_decimal(s): - if s is None: + if s is None or s == '': return None return decimal.Decimal(s)