# HG changeset patch # User neko259 # Date 2018-08-05 05:52:58 # Node ID edce8526e66073d12974dec41c6a4666a4676ba4 # Parent b378f45d08bc182c6a8d9af6dc21b0cd51193ece Serialize timestamp before passing to tag. Fail if the passed timestamp is invalid and cannot be parsed diff --git a/boards/abstracts/sync_filters.py b/boards/abstracts/sync_filters.py --- a/boards/abstracts/sync_filters.py +++ b/boards/abstracts/sync_filters.py @@ -62,5 +62,5 @@ class TimestampFromFilter(PostFilter): def add_filter(self, model_tag, value): tags_from_time = et.SubElement(model_tag, TAG_TIME_FROM) - tags_from_time.text = value + tags_from_time.text = str(value) diff --git a/boards/management/commands/sync_with_server.py b/boards/management/commands/sync_with_server.py --- a/boards/management/commands/sync_with_server.py +++ b/boards/management/commands/sync_with_server.py @@ -72,6 +72,9 @@ class Command(BaseCommand): timestamp = None if timestamp_str: timestamp = parse_datetime(timestamp_str) + if not timestamp: + raise Exception('Timestamp {} cannot be parsed'.format( + timestamp_str)) xml = SyncManager.generate_request_list( opening_post=options.get('thread'), tags=tags,