Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Thing: Use a hook for on_thing_commit.

  • Loading branch information...
commit f7f5d26d3ee2f3b445de4593259e2ee8b05f1da4 1 parent 5bd81b5
@spladug spladug authored
Showing with 2 additions and 8 deletions.
  1. +2 −2 r2/r2/lib/db/thing.py
  2. +0 −6 r2/r2/lib/plugin.py
View
4 r2/r2/lib/db/thing.py
@@ -35,7 +35,7 @@
from r2.config import cache
from r2.lib.cache import sgm
from r2.lib.log import log_text
-from r2.lib import stats
+from r2.lib import stats, hooks
from pylons import g
@@ -297,7 +297,7 @@ def _commit(self, keys=None):
if lock:
lock.release()
- g.plugins.on_thing_commit(self, to_set)
+ hooks.get_hook("thing.commit").call(thing=self, changes=to_set)
@classmethod
def _load_multi(cls, need):
View
6 r2/r2/lib/plugin.py
@@ -78,8 +78,6 @@ def add_routes(self, mc):
def load_controllers(self):
pass
- def on_thing_commit(self, thing, changes):
- pass
class PluginLoader(object):
@@ -149,7 +147,3 @@ def load_plugins(self):
def load_controllers(self):
for plugin in self:
plugin.load_controllers()
-
- def on_thing_commit(self, thing, changes):
- for plugin in self:
- plugin.on_thing_commit(thing, changes)
Please sign in to comment.
Something went wrong with that request. Please try again.