-
Notifications
You must be signed in to change notification settings - Fork 23
Postmovement #80
base: master
Are you sure you want to change the base?
Postmovement #80
Conversation
…an error message instead of crashing.
|
||
self.moderator_banned = not c.user_is_admin | ||
self.banner = c.user.name | ||
#self.moved = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be commented out?
…o comment.parent_id now safed.
The changes you suggested are implemented. |
Now that 'interestingness' is live, moving posts also needs to change descendant_karma accordingly |
Moving posts? On Thu, Sep 5, 2013 at 6:25 PM, keyist notifications@github.com wrote:
"And someday when the descendants of humanity have spread from star to -Eliezer Yudkowsky "Trust me" means "I love you" http://project-apollo.net/mos/mos114.html "This isn't even my final form!" -Tim Hausler |
Sorry, meant moving comments between posts, i.e. when a comment is moved, descendant_karma of {source,destination} parent need to be updated |
Hmm. My working theory was that if the original context caused a On Sun, Sep 15, 2013 at 11:19 PM, keyist notifications@github.com wrote:
"And someday when the descendants of humanity have spread from star to -Eliezer Yudkowsky "Trust me" means "I love you" http://project-apollo.net/mos/mos114.html "This isn't even my final form!" -Tim Hausler |
It boils down to whether we want I feel the latter should be avoided: deliberately storing imprecise values makes any functionality that exercises that data suspect. Sorting by If you think the impact on the original context has value, then we should track both values separately ( |
Ok, that definitely makes sense. I'll have the change up by (your) monday. On Thu, Sep 19, 2013 at 12:02 AM, keyist notifications@github.com wrote:
"And someday when the descendants of humanity have spread from star to -Eliezer Yudkowsky "Trust me" means "I love you" http://project-apollo.net/mos/mos114.html "This isn't even my final form!" -Tim Hausler |
…ings/lesswrong into postmovement Conflicts: r2/r2/templates/comment.html
Sorry, this is going to take more time. I've come across an issue with how On Thu, Sep 19, 2013 at 9:36 AM, Lucas Sloan <
"And someday when the descendants of humanity have spread from star to -Eliezer Yudkowsky "Trust me" means "I love you" http://project-apollo.net/mos/mos114.html "This isn't even my final form!" -Tim Hausler |
…ings/lesswrong into postmovement Conflicts: r2/r2/models/link.py
@@ -129,30 +129,50 @@ def get_rel_type_table(metadata): | |||
|
|||
|
|||
def get_thing_table(metadata, name): | |||
table = sa.Table(settings.DB_APP_NAME + '_thing_' + name, metadata, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you've caused a fair bit of duplication here. Why is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding the column doesn't work.
class MoveBox(Wrapped): | ||
"""Used on LinkInfoPage to render the move thread form.""" | ||
def __init__(self, link_name='', captcha=None, action = 'comment'): | ||
Wrapped.__init__(self, link_name = link_name, captcha = captcha, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the default action for a move thread form "comment"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason. Holdover from the initialization for what the movebox was created from. I'll remove it.
I think I'm still getting my head into the LW codebase and it means I'm stuck code-reviewing at the nitpick-level. I'll pull this into a private branch and have a play with it. |
destination._incr('_descendant_karma', thing._descendant_karma + thing._ups - thing._downs) | ||
if hasattr(thing, 'parent_id'): | ||
parent = Comment._byID(thing.parent_id) | ||
parent.incr_descendant_karma([], -(thing._descendant_karma + thing._ups - thing._downs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pylons gives me an error here when I try to move a comment thread to a different article:
Module r2.lib.jsonresponse:181 in _Json
>> val = func(self, res, *a, **kw)
Module r2.controllers.validator.validator:78 in newfn
>> return fn(self, *a, **kw)
Module r2.controllers.api:229 in POST_move
>> currlink._incr('_descendant_karma', -(thing._descendant_karma + thing._ups - thing._downs))
Module r2.lib.db.thing:497 in __getattr__
>> return DataThing.__getattr__(self, attr)
Module r2.lib.db.thing:124 in __getattr__
>> raise AttributeError, '%s not found' % attr
<type 'exceptions.AttributeError'>: _descendant_karma not found
I had created a couple of articles while on the master branch, then switched to the postmovement branch and tried to move some comments around and got this error. Perhaps it is relying on something that is not being set by current (in production) code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to run a script in the sql folder to add descendant karma to the SQL database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you need #94.
I can't seem to move a comment tree under another comment. It will always put the comment tree at the top level: Suppose on article A1 I have the following comment tree:
And I have this comment tree on article A2:
I moved comment B, giving it the URL of comment D. I expected this sort of tree:
But it made this:
Is this a bug or am I misunderstanding the feature request? |
Also, I am seeing this error occasionally but I can't reliably reproduce it yet. Any ideas:
EDIT: Somehow I have comments with |
http://code.google.com/p/lesswrong/issues/detail?id=384&sort=-id&colspec=ID%20Estimate%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Contributions
Allows moderators to move comment threads from one post to another.