Merge branch 'devel' into 'master'

Regression fix (issue #18, #20)

Closes #20

See merge request oliver/ivatar!75
This commit is contained in:
Oliver Falk
2018-11-16 12:13:01 +01:00

View File

@@ -127,7 +127,12 @@ class AvatarImageView(TemplateView):
if str(default) == 'mm' or str(default) == 'mp':
# If mm is explicitly given, we need to catch that
pass
static_img = path.join('static', 'img', 'mm', '%s%s' % (str(size), '.png'))
if not path.isfile(static_img):
# We trust this exists!!!
static_img = path.join('static', 'img', 'mm', '512.png')
# We trust static/ is mapped to /static/
return HttpResponseRedirect('/' + static_img)
else:
return HttpResponseRedirect(default)