We shouldn't call dateutil.parser if t has already been deserialized to a datetime.

This commit is contained in:
Fabio Manganiello 2023-09-27 11:20:10 +02:00
parent c311987741
commit ca7f042ccc
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 3 additions and 1 deletions

View File

@ -82,7 +82,9 @@ class RssPlugin(RunnablePlugin):
t = var.get(varname)
if t:
return dateutil.parser.isoparse(t)
if not isinstance(t, datetime.datetime):
t = dateutil.parser.isoparse(t)
return t
return None