Skip to content

Commit

Permalink
Small fixes to port-eu-post.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSto committed Oct 28, 2022
1 parent ea5f8dd commit 2f5d345
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/port-eu-post.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def main(argv):

# Create the directory.
logging.info(f'Creating post directory: {post_dir}')
if post_dir.exists():
fail(f'Post directory already exists: {post_dir}')
if not args.simulate:
if post_dir.exists():
fail(f'Post directory already exists: {post_dir}')
post_dir.mkdir()

#TODO: Modify content?
Expand Down Expand Up @@ -133,7 +133,9 @@ def make_metadata(input_path, old_metadata, content, add_tease=True):
elif key in ('organiser', 'organisers'):
# `organiser` -> `contacts`
new_key = 'contacts'
if isinstance(value, list):
if value is None:
continue
elif isinstance(value, list):
for item in value:
validate_dict(item, {'name', 'email'}, {'name'})
new_value = value
Expand Down

0 comments on commit 2f5d345

Please sign in to comment.