Skip to content

Commit

Permalink
skip non-file attachments
Browse files Browse the repository at this point in the history
For other attachments such as links, there is no filename.
In the future, these could be handled more cleverly, e.g. by creating a file
containing a link.
  • Loading branch information
olifre committed Sep 18, 2023
1 parent 1541d59 commit 7f105d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions indico-fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def exec_request(indico_instance, request_path):
mod = attachment['modified_dt']
mtime = dateutil.parser.parse(mod)
mtimets = int(time.mktime(mtime.timetuple()))
if attachment['type'] != 'file':
print('Skipping non-file attachment...')
continue
full_filename = fulldir + "/" + str(mtimets) + "_" + attachment['filename']

if not os.path.isfile(full_filename):
Expand Down

0 comments on commit 7f105d0

Please sign in to comment.