mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-24 22:38:09 -05:00
Make the edit box appear when editing a blank self post.
This commit is contained in:
@@ -84,6 +84,9 @@ except ImportError:
|
||||
class _Unsafe(unicode): pass
|
||||
|
||||
def _force_unicode(text):
|
||||
if text == None:
|
||||
return u''
|
||||
|
||||
try:
|
||||
text = unicode(text, 'utf-8')
|
||||
except UnicodeDecodeError:
|
||||
|
||||
@@ -2811,19 +2811,20 @@ def make_link_child(item):
|
||||
if media_embed:
|
||||
link_child = MediaChild(item, media_embed, load = True)
|
||||
|
||||
# if the item has selftext, add a selftext child
|
||||
elif item.selftext:
|
||||
# if the item is_self, add a selftext child
|
||||
elif item.is_self:
|
||||
if not item.selftext: item.selftext = u''
|
||||
|
||||
expand = getattr(item, 'expand_children', False)
|
||||
link_child = SelfTextChild(item, expand = expand,
|
||||
nofollow = item.nofollow)
|
||||
#draw the edit button if the contents are pre-expanded
|
||||
|
||||
editable = (expand and
|
||||
item.author == c.user and
|
||||
not item._deleted)
|
||||
not item._deleted)
|
||||
link_child = SelfTextChild(item, expand = expand,
|
||||
nofollow = item.nofollow)
|
||||
|
||||
return link_child, editable
|
||||
|
||||
|
||||
class MediaChild(LinkChild):
|
||||
"""renders when the user hits the expando button to expand media
|
||||
objects, like embedded videos"""
|
||||
|
||||
Reference in New Issue
Block a user