##// END OF EJS Templates
Serialize timestamp before passing to tag. Fail if the passed timestamp is invalid and cannot be parsed
neko259 -
r2122:edce8526 default
parent child Browse files
Show More
@@ -62,5 +62,5 class TimestampFromFilter(PostFilter):
62
62
63 def add_filter(self, model_tag, value):
63 def add_filter(self, model_tag, value):
64 tags_from_time = et.SubElement(model_tag, TAG_TIME_FROM)
64 tags_from_time = et.SubElement(model_tag, TAG_TIME_FROM)
65 tags_from_time.text = value
65 tags_from_time.text = str(value)
66
66
@@ -72,6 +72,9 class Command(BaseCommand):
72 timestamp = None
72 timestamp = None
73 if timestamp_str:
73 if timestamp_str:
74 timestamp = parse_datetime(timestamp_str)
74 timestamp = parse_datetime(timestamp_str)
75 if not timestamp:
76 raise Exception('Timestamp {} cannot be parsed'.format(
77 timestamp_str))
75
78
76 xml = SyncManager.generate_request_list(
79 xml = SyncManager.generate_request_list(
77 opening_post=options.get('thread'), tags=tags,
80 opening_post=options.get('thread'), tags=tags,
General Comments 0
You need to be logged in to leave comments. Login now