Commit e5b20c8b authored by Alain St-Denis's avatar Alain St-Denis
Browse files

Merge branch 'trfix' into 'master'

Fallback to default locale (en-us) when a locale is not supported in Arrow

See merge request !578
parents c89a0157 ec2d9d78
Pipeline #6546 passed with stages
in 13 minutes and 5 seconds
......@@ -20,6 +20,7 @@ Fixed
.....
* Add the code to deal with tag-by-uuid in the streams/viewsets.py and streams/urls/api.py. (`#607 <https://git.feneas.org/socialhome/socialhome/issues/607>`_)
* Fallback to default locale (en-us) when a locale is not supported in Arrow.
0.13.0 (2021-08-15)
-------------------
......
......@@ -248,7 +248,11 @@ class Content(models.Model):
@property
def humanized_timestamp(self):
"""Human readable timestamp ie '2 hours ago'."""
return arrow.get(self.modified).humanize(locale=get_language())
try:
humanized = arrow.get(self.modified).humanize(locale=get_language())
except ValueError:
humanized = arrow.get(self.modified).humanize()
return humanized
@cached_property
def root(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment