8000 Fix minor bug in request factory due to bool(time(0,0))==False in Pyt… · rmagier1/server-client-python@d8651a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8651a7

Browse files
guodahChris Shin
authored andcommitted
Fix minor bug in request factory due to bool(time(0,0))==False in Python 3.4 (tableau#545)
* fixing a bug due to bool(time(0,0)) is false * change the null check for end_time at another place
1 parent 0f6a5bc commit d8651a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tableauserverclient/server/request_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def create_req(self, schedule_item):
276276
schedule_element.attrib['frequency'] = interval_item._frequency
277277
frequency_element = ET.SubElement(schedule_element, 'frequencyDetails')
278278
frequency_element.attrib['start'] = str(interval_item.start_time)
279-
if hasattr(interval_item, 'end_time') and interval_item.end_time:
279+
if hasattr(interval_item, 'end_time') and interval_item.end_time is not None:
280280
frequency_element.attrib['end'] = str(interval_item.end_time)
281281
if hasattr(interval_item, 'interval') and interval_item.interval:
282282
intervals_element = ET.SubElement(frequency_element, 'intervals')
@@ -302,7 +302,7 @@ def update_req(self, schedule_item):
302302
schedule_element.attrib['frequency'] = interval_item._frequency
303303
frequency_element = ET.SubElement(schedule_element, 'frequencyDetails')
304304
frequency_element.attrib['start'] = str(interval_item.start_time)
305-
if hasattr(interval_item, 'end_time') and interval_item.end_time:
305+
if hasattr(interval_item, 'end_time') and interval_item.end_time is not None:
306306
frequency_element.attrib['end'] = str(interval_item.end_time)
307307
intervals_element = ET.SubElement(frequency_element, 'intervals')
308308
if hasattr(interval_item, 'interval'):

0 commit comments

Comments
 (0)
0