'verification_key': unicode,
'is_admin': bool,
'url' : unicode,
- 'bio' : unicode
+ 'bio' : unicode, # May contain markdown
+ 'bio_html': unicode, # May contain plaintext, or HTML
}
required_fields = ['username', 'created', 'pw_hash', 'email']
if request.method == 'POST' and form.validate():
user['url'] = request.POST['url']
user['bio'] = request.POST['bio']
+
+ md = markdown.Markdown(safe_mode = 'escape')
+ user['bio_html'] = clean_html(md.convert(user['bio']))
+
user.save()
messages.add_message(request,