From 87685c4a62b8701c1e896ab22d7be7b1d0c54e7b Mon Sep 17 00:00:00 2001 From: Domeniko Gentner Date: Fri, 4 Dec 2020 12:19:24 +0100 Subject: [PATCH] Always download gravatar, there is no good way to check it without storing the etag and complicating things --- labertasche/helper/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/labertasche/helper/__init__.py b/labertasche/helper/__init__.py index 2cd3199..9ba62aa 100644 --- a/labertasche/helper/__init__.py +++ b/labertasche/helper/__init__.py @@ -92,11 +92,10 @@ def check_gravatar(email: str): response = requests.get(url) if response.ok: outfile = Path(f"{options['static_dir']}/{gravatar_hash}.jpg") - if not outfile.exists(): - with outfile.open('wb') as fp: - response.raw.decode_content = True - for chunk in response: - fp.write(chunk) + with outfile.open('wb') as fp: + response.raw.decode_content = True + for chunk in response: + fp.write(chunk) return gravatar_hash