Commit dc9392e6 authored by Phyks's avatar Phyks

Fix an error with photos hashes in the fetch command

parent 35c902d3
Pipeline #79788 failed with stage
in 5 minutes and 6 seconds
......@@ -15,6 +15,7 @@ import math
import re
import time
import imagehash
import mapbox
import requests
import unidecode
......@@ -128,7 +129,13 @@ class DateAwareJSONEncoder(json.JSONEncoder):
def default(self, o): # pylint: disable=locally-disabled,E0202
if isinstance(o, (datetime.date, datetime.datetime)):
return o.isoformat()
return json.JSONEncoder.default(self, o)
try:
return json.JSONEncoder.default(self, o)
except TypeError:
# Discard image hashes
if isinstance(o, imagehash.ImageHash):
return None
raise
def pretty_json(data):
......
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