update comment count after deleting a comment

This commit is contained in:
shuffman
2008-06-26 13:28:39 -07:00
parent 413fb20f0a
commit 622d11e1a8
4 changed files with 8 additions and 2 deletions

1
.gitignore vendored
View File

@@ -21,6 +21,7 @@ r2/r2/public/static/vote.js
r2/r2/public/static/reddit_rtl.css
r2/data/*
r2/count.pickle
r2/srcount.pickle
r2/myproduction.ini
.DS_Store
r2/r2.egg-info/**

View File

@@ -502,6 +502,10 @@ class ApiController(RedditController):
sr = thing.subreddit_slow
expire_hot(sr)
#comments have special delete tasks
elif isinstance(thing, Comment):
thing._delete()
@Json
@validate(VUser(), VModhash(),

View File

@@ -258,7 +258,8 @@ class Comment(Thing, Printable):
pass
def _delete(self):
pass
link = Link._byID(self.link_id, data = True)
link._incr('num_comments', -1)
@classmethod
def _new(cls, author, link, parent, body, ip, spam = False):

View File

@@ -1,4 +1,4 @@
## "The contents of this file are subject to the Common Public Attribution
## The contents of this file are subject to the Common Public Attribution
## License Version 1.0. (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License at
## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public