Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Record changing of ban length
Browse files Browse the repository at this point in the history
If a mod changes the length of a user's subreddit ban, make
a record of this in the mod log to keep things public.
  • Loading branch information
MelissaCole committed Oct 1, 2015
1 parent e7adea1 commit 0d412f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions r2/r2/controllers/api.py
Expand Up @@ -1105,18 +1105,20 @@ def POST_friend(self, form, jquery, friend,
c.user,
duration,
)
log_details = "%d days" % duration
log_details = "changed to " if not new else ""
log_details += "%d days" % duration
elif not new:
# Preexisting ban and no duration specified means turn the
# temporary ban into a permanent one.
container.unschedule_unban(friend, type)
log_details = "changed to permanent"
else:
log_details = "permanent"
elif new and type == 'muted':
MutedAccountsBySubreddit.mute(container, friend, c.user)

# Log this action
if new and type in self._sr_friend_types:
if (new or log_details) and type in self._sr_friend_types:
mod_action_by_type = {
"banned": "banuser",
"muted": "muteuser",
Expand Down

0 comments on commit 0d412f4

Please sign in to comment.