Skip to content
Snippets Groups Projects
Commit b2911f4f authored by kaiyou's avatar kaiyou
Browse files

Fix HTML encoding of captcha strings

parent 53d02e5e
No related branches found
No related tags found
1 merge request!20Add 'remember me' button
Pipeline #1898 passed
...@@ -64,8 +64,7 @@ class ImageCaptchaField(fields.CaptchaField): ...@@ -64,8 +64,7 @@ class ImageCaptchaField(fields.CaptchaField):
output = base64.b64encode(png.getvalue()).decode("ascii") output = base64.b64encode(png.getvalue()).decode("ascii")
return widgets.HTMLString( return widgets.HTMLString(
'<p><img src="data:image/png;base64,{}"></p>'.format(output) '<p><img src="data:image/png;base64,{}"></p>'.format(output)
+ super(ImageCaptchaField, self).__call__(**kwargs) ) + super(ImageCaptchaField, self).__call__(**kwargs)
)
def make_char(self, char, rotation_range=15): def make_char(self, char, rotation_range=15):
""" Renders a character """ Renders a character
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment