mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-03 19:25:01 -05:00
update comment count after deleting a comment
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -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/**
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user