Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
03bae0d
Moderators can now move comment threads between posts.
LucasSloan Jul 23, 2013
a95fa1a
Children of original movers now hidden for non-admins.
LucasSloan Jul 23, 2013
c7fc246
Made it impossible to vote on moved items.
LucasSloan Jul 23, 2013
2739bef
Status message removed in the event of failed call.
LucasSloan Jul 23, 2013
eefd50e
Entering an properly formatted URL that doesn't lead to a post sends …
LucasSloan Jul 23, 2013
f3721e5
Changed movebox doc string, renamed Link._byURL to Link._move_url.
LucasSloan Jul 24, 2013
afe23b1
Added a lock to movement.
LucasSloan Jul 24, 2013
582d9fd
Changed move proceedure to no longer create new comments. All calls …
LucasSloan Jul 27, 2013
ac9ed72
Removed debugging statements, moved boolean.
LucasSloan Jul 27, 2013
fa13a33
Safed movement against editor trying to move children of already move…
LucasSloan Jul 27, 2013
b7e7355
Merge branch 'interesting_comments' of https://github.com/PotatoDumpl…
LucasSloan Sep 21, 2013
91d0c4e
Descendant karma attribute no longer disappears off python objects.
LucasSloan Oct 1, 2013
bedd944
Merge branch 'interesting_comments' of https://github.com/PotatoDumpl…
LucasSloan Oct 1, 2013
cf10a31
Thread movement now properly increments descendant karma.
LucasSloan Oct 1, 2013
2edef55
Descendant karma attribute no longer disappears off python objects.
LucasSloan Oct 1, 2013
33a3850
Merge branch 'interesting_comments' of https://github.com/PotatoDumpl…
LucasSloan Oct 1, 2013
2124bd7
Changed testing syntax.
LucasSloan Dec 9, 2013
9bdf974
Merge branch 'postmovement' of https://github.com/PotatoDumplings/les…
LucasSloan Dec 9, 2013
ce3d6ff
Merge branch 'master' of https://github.com/tricycle/lesswrong into p…
LucasSloan Dec 9, 2013
5e5f092
Variety of small changes for readability.
LucasSloan Dec 9, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed testing syntax.
  • Loading branch information
LucasSloan committed Dec 9, 2013
commit 2124bd7d57bea1b779b46075712d4324390c6d0d
2 changes: 1 addition & 1 deletion r2/r2/controllers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def POST_move(self, res, thing, destination, reason, ip):
g.permacache.delete(comments_key(currlink._id))
g.permacache.delete(comments_key(destination._id))

body = "A comment was moved from here to [here]({0}).\n\n".format(thing.make_anchored_permalink(destination)) + (reason if reason else '')
body = "A comment was moved to [here]({0}).\n\n".format(thing.make_anchored_permalink(destination)) + (reason if reason else '')

comment, inbox_rel = Comment._new(c.user,
currlink, parent, body,
Expand Down
13 changes: 5 additions & 8 deletions r2/r2/models/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,11 @@ def keep_item(self, item):
class ToplevelCommentBuilder(UnbannedCommentBuilder):
def keep_item(self, item):
try:
item.parent_id
parent_id = item.parent_id
except AttributeError:
return True
else:
if item.parent_id:
return False
else:
return True

return parent_id is not None

class ContextualCommentBuilder(CommentBuilderMixin, UnbannedCommentBuilder):
def __init__(self, query, sr_ids, **kw):
Expand Down Expand Up @@ -577,7 +574,7 @@ def get_items(self, num, nested = True, starting_depth = 0):
top = self.comment
dont_collapse.append(top._id)
#add parents for context
while self.context > 0 and hasattr(top, 'parent_id') and top.parent_id:
while self.context > 0 and hasattr(top, 'parent_id') and top.parent_id is not None:
self.context -= 1
new_top = comment_dict[top.parent_id]
comment_tree[new_top._id] = [top]
Expand Down Expand Up @@ -660,7 +657,7 @@ def sort_candidates():
to_add = candidates.pop(0)
direct_child = True
#ignore top-level comments for now
if not hasattr(to_add, 'parent_id') or not to_add.parent_id:
if not hasattr(to_add, 'parent_id') or to_add.parent_id is not None:
p_id = None
else:
#find the parent actually being displayed
Expand Down