Fix regression introduced by commit c3ed5fb0 (issue #18 - fixes issue #20

This commit is contained in:
Oliver Falk
2018-11-16 12:08:11 +01:00
parent 3be9611cf8
commit c6710052d2

View File

@@ -127,7 +127,12 @@ class AvatarImageView(TemplateView):
if str(default) == 'mm' or str(default) == 'mp': if str(default) == 'mm' or str(default) == 'mp':
# If mm is explicitly given, we need to catch that # 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: else:
return HttpResponseRedirect(default) return HttpResponseRedirect(default)