From 675decfea75a6ef10c8d9444debcb30873ae9299 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 03 2019 11:05:02 +0000 Subject: By pass date_key that already are numbers Turns out some of the fields we are trying to convert to unit timestamp may already be timestamp but we do not know which. So instead, if the value is already a float or a int, just don't convert it and continue. Signed-off-by: Pierre-Yves Chibon --- diff --git a/fedmsg-koji-plugin.py b/fedmsg-koji-plugin.py index df33431..f246bc0 100644 --- a/fedmsg-koji-plugin.py +++ b/fedmsg-koji-plugin.py @@ -37,6 +37,8 @@ def serialize_datetime_in_task(task): for date_key in date_fields: if task.get(date_key) is None: continue + if isinstance(task[date_key], (float, int)): + continue task[date_key] = time.mktime(task[date_key].timetuple())