File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -293,10 +293,14 @@ def get_formatted_scans_key_row(item):
293
293
force = True ))
294
294
# we need to store filenames and acquisition times
295
295
# parse date and time and get it into isoformat
296
- date = mw .dcm_data .ContentDate
297
- time = mw .dcm_data .ContentTime .split ('.' )[0 ]
298
- td = time + date
299
- acq_time = datetime .strptime (td , '%H%M%S%Y%m%d' ).isoformat ()
296
+ try :
297
+ date = mw .dcm_data .ContentDate
298
+ time = mw .dcm_data .ContentTime .split ('.' )[0 ]
299
+ td = time + date
300
+ acq_time = datetime .strptime (td , '%H%M%S%Y%m%d' ).isoformat ()
301
+ except AttributeError as exc :
302
+ lgr .warning ("Failed to get date/time for the content: %s" , str (exc ))
303
+ acq_time = None
300
304
# add random string
301
305
randstr = '' .join (map (chr , sample (k = 8 , population = range (33 , 127 ))))
302
306
try :
You can’t perform that action at this time.
0 commit comments