fix: Make sure the publish timestamp is bumped on update

pull/511/head
Raphaël Vinot 2019-12-11 22:54:54 +01:00
parent 3983efa373
commit 062aa30c0e
1 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
from dateutil.parser import parse
import csv
from pathlib import Path
@ -261,6 +262,9 @@ class Scrippts:
writer.writerow([infofield, f'{event.uuid}.json'])
object_creator(event, location, filepath, update)
if update:
# Bump the publish timestamp
event.publish_timestamp = datetime.datetime.timestamp(datetime.datetime.now())
feed_output = event.to_feed(with_meta=False)
with (self.output_dir / f'{event.uuid}.json').open('w') as f:
# json.dump(feed_output, f, indent=2, sort_keys=True) # For testing