handle invalid lecture file format with invalid title

This commit is contained in:
Maximilian Keßler 2021-09-17 09:48:16 +02:00
parent 12b1632f8e
commit 4e71f12254

View File

@ -30,12 +30,17 @@ class Lecture:
break break
# number = int(lecture_match.group(1)) # number = int(lecture_match.group(1))
if lecture_match:
date_str = lecture_match.group(2)
date = datetime.strptime(date_str, DATE_FORMAT)
week = get_week(date)
date_str = lecture_match.group(2) title = lecture_match.group(3)
date = datetime.strptime(date_str, DATE_FORMAT) else:
week = get_week(date) date = datetime.min
week = get_week(date)
title = lecture_match.group(3) title = 'Error while parsing lecture file'
self.file_path = file_path self.file_path = file_path
self.date = date self.date = date