Merge pull request #278 from adbenitez/adbenitez/fix-bug-in-json_date_parse

fix NameError: name 'x' is not defined in __json_date_parse()
This commit is contained in:
Lorenz Diener 2022-11-24 22:11:53 +02:00 committed by GitHub
commit c3cfb197a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3564,7 +3564,7 @@ class Mastodon:
else:
json_object[k] = dateutil.parser.parse(v)
except:
if isinstance(v, str) and len(x.strip()) == 0:
if isinstance(v, str) and len(v.strip()) == 0:
# Pleroma bug workaround: Empty string becomes start of epoch
json_object[k] = datetime.datetime.fromtimestamp(0)
else: