Skip to content

Instantly share code, notes, and snippets.

@c0nstantine
Created April 17, 2017 19:29
Show Gist options
  • Save c0nstantine/6f8cc1ad0b1e4516b4266cd037a65e92 to your computer and use it in GitHub Desktop.
Save c0nstantine/6f8cc1ad0b1e4516b4266cd037a65e92 to your computer and use it in GitHub Desktop.
In [38]: from django.utils.html import strip_tags
In [39]: strip_tags(None)
Out[39]: u'None'
In [40]: post = {'brief': None}
In [41]: strip_tags(post.get('brief', ''))
Out[41]: u'None'
In [42]: strip_tags(post.get('brief') or '')
Out[42]: u''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment