mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Allow deleted stickied posts to be unstickied
This commit is contained in:
@@ -1648,13 +1648,14 @@ class ApiController(RedditController):
|
||||
if not isinstance(thing, Link):
|
||||
return
|
||||
|
||||
if thing._deleted or thing._spam:
|
||||
sr = thing.subreddit_slow
|
||||
stickied = thing._fullname in sr.get_sticky_fullnames()
|
||||
|
||||
if not stickied and (thing._deleted or thing._spam):
|
||||
abort(400, "Can't sticky a removed or deleted post")
|
||||
|
||||
sr = thing.subreddit_slow
|
||||
|
||||
if state:
|
||||
if thing._fullname in sr.get_sticky_fullnames():
|
||||
if stickied:
|
||||
abort(409, "Already stickied")
|
||||
sr.set_sticky(thing, c.user, num=num)
|
||||
else:
|
||||
|
||||
@@ -5293,7 +5293,13 @@ class LinkCommentsSettings(Templated):
|
||||
(c.user_is_admin or
|
||||
self.sr.is_moderator_with_perms(c.user, "posts"))
|
||||
)
|
||||
self.can_sticky = self.can_edit and not (link._deleted or link._spam)
|
||||
self.can_sticky = False
|
||||
if self.can_edit:
|
||||
if self.stickied:
|
||||
# always allow un-stickying things
|
||||
self.can_sticky = True
|
||||
elif not (link._deleted or link._spam):
|
||||
self.can_sticky = True
|
||||
self.sort = sort
|
||||
self.suggested_sort = suggested_sort
|
||||
|
||||
|
||||
Reference in New Issue
Block a user