Compare commits

...

2 Commits

Author SHA1 Message Date
Danielle McLean 37d5a7a20d
Do a pipenv update to get patched Django 2021-08-22 23:24:58 +10:00
Danielle McLean 76496e7169
Harmlessly ignore bad params to Libravatar
I was throwing 400s when bad parameters are provided, but the spec
actually says you're supposed to just ignore them entirely.
2021-08-22 23:08:45 +10:00
3 changed files with 888 additions and 545 deletions

1426
Pipfile.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,3 +3,6 @@ from .base import *
ALLOWED_HOSTS = ['*']
SECURE_SSL_REDIRECT = False
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
MEDIA_URL = '/media/'
STATIC_ROOT = path.join(BASE_DIR, 'media')

View File

@ -21,9 +21,9 @@ def libravatar(request, hash):
try:
size = int(size)
except ValueError:
return utils.bad_req('size parameter must be an integer')
size = 80
if not 1 <= size <= 512:
return utils.bad_req('size parameter must be between 1 and 512')
size = 512
if len(hash) == 32:
where = Q(email_md5=hash)