Always download gravatar, there is no good way to check it without storing the etag and complicating things

This commit is contained in:
Domeniko Gentner 2020-12-04 12:19:24 +01:00
parent 9c122022f1
commit 87685c4a62

View File

@ -92,11 +92,10 @@ def check_gravatar(email: str):
response = requests.get(url) response = requests.get(url)
if response.ok: if response.ok:
outfile = Path(f"{options['static_dir']}/{gravatar_hash}.jpg") outfile = Path(f"{options['static_dir']}/{gravatar_hash}.jpg")
if not outfile.exists(): with outfile.open('wb') as fp:
with outfile.open('wb') as fp: response.raw.decode_content = True
response.raw.decode_content = True for chunk in response:
for chunk in response: fp.write(chunk)
fp.write(chunk)
return gravatar_hash return gravatar_hash