aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index d0b3606..6a783b4 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -3647,11 +3647,8 @@ class Mastodon:
3647 else: 3647 else:
3648 json_object[k] = dateutil.parser.parse(v) 3648 json_object[k] = dateutil.parser.parse(v)
3649 except: 3649 except:
3650 if isinstance(v, str) and len(v.strip()) == 0: 3650 # When we can't parse a date, we just leave the field out
3651 # Pleroma bug workaround: Empty string becomes start of epoch 3651 del json_object[k]
3652 json_object[k] = datetime.datetime.fromtimestamp(0)
3653 else:
3654 raise MastodonAPIError('Encountered invalid date.')
3655 return json_object 3652 return json_object
3656 3653
3657 @staticmethod 3654 @staticmethod
Powered by cgit v1.2.3 (git 2.41.0)