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

Commit

Permalink
Subreddit: Insert fake sr modactions into the default sr
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-d authored and spladug committed Sep 11, 2012
1 parent 74a926b commit 3c70bc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion r2/r2/models/modaction.py
Expand Up @@ -23,6 +23,7 @@
from r2.lib.db import tdb_cassandra
from r2.lib.utils import tup
from r2.models import Account, Subreddit, Link, Comment, Printable
from r2.models.subreddit import DefaultSR
from pycassa.system_manager import TIME_UUID_TYPE
from uuid import UUID
from pylons.i18n import _
Expand Down Expand Up @@ -161,7 +162,10 @@ def create(cls, sr, mod, action, details=None, target=None, description=None):
# Split this off into separate function to check for valid actions?
if not action in cls.actions:
raise ValueError("Invalid ModAction: %s" % action)


# Front page should insert modactions into the base sr
sr = sr._base if isinstance(sr, DefaultSR) else sr

kw = dict(sr_id36=sr._id36, mod_id36=mod._id36, action=action)

if target:
Expand Down

0 comments on commit 3c70bc8

Please sign in to comment.