backend/server/handlers/app/packages.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 22514fb9bd28df22e4deeaf5dd775261a097b47e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Nov 23 12:49:19 2010 +0100
Handle both the empty string (convert it to NULL) and numbers (convert them to
strings) in epochs.
diff --git a/backend/server/handlers/app/packages.py
b/backend/server/handlers/app/packages.py
index f4f8d36..c1b7f0e 100644
--- a/backend/server/handlers/app/packages.py
+++ b/backend/server/handlers/app/packages.py
@@ -501,9 +501,14 @@ class Packages(RPC_Base):
for pkg in pkg_infos.keys():
pkg_info = pkg_infos[pkg]
- pkg_epoch = None
- if pkg_info['epoch'] != '':
- pkg_epoch = pkg_info['epoch']
+ pkg_epoch = pkg_info['epoch']
+ if pkg_epoch is not None:
+ # Force empty strings to None (NULLs in database)
+ if pkg_epoch == '':
+ pkg_epoch = None
+ # and force numbers to strings
+ else:
+ pkg_epoch = str(pkg_epoch)
query_args = {
'pkg_name': pkg_info['name'],
Show replies by date