~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to pybb/views.py

  • Committer: franku
  • Date: 2019-04-11 15:06:09 UTC
  • mto: This revision was merged to the branch mainline in revision 540.
  • Revision ID: somal@arcor.de-20190411150609-801l72ffxgr6gkui
converted to python 3.6 using 2to3 script

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
    content = request.POST.get('content')
366
366
    markup = request.POST.get('markup')
367
367
 
368
 
    if not markup in dict(MARKUP_CHOICES).keys():
 
368
    if not markup in list(dict(MARKUP_CHOICES).keys()):
369
369
        return {'error': 'Invalid markup'}
370
370
 
371
371
    if not content:
374
374
    if markup == 'bbcode':
375
375
        html = mypostmarkup.markup(content, auto_urls=False)
376
376
    elif markup == 'markdown':
377
 
        html = unicode(do_wl_markdown(content, 'bleachit'))
 
377
        html = str(do_wl_markdown(content, 'bleachit'))
378
378
 
379
379
    html = urlize(html)
380
380
    return {'content': html}