|
@@ -11,7 +11,7 @@
|
|
from datetime import timedelta
|
|
from datetime import timedelta
|
|
import logging
|
|
import logging
|
|
|
|
|
|
-from flask import abort, url_for
|
|
|
|
|
|
+from flask import abort, current_app, url_for
|
|
from sqlalchemy.orm import aliased
|
|
from sqlalchemy.orm import aliased
|
|
|
|
|
|
from flaskbb.extensions import db
|
|
from flaskbb.extensions import db
|
|
@@ -205,6 +205,8 @@ class Post(HideableCRUDMixin, db.Model):
|
|
if self.id:
|
|
if self.id:
|
|
db.session.add(self)
|
|
db.session.add(self)
|
|
db.session.commit()
|
|
db.session.commit()
|
|
|
|
+ current_app.pluggy.hook.flaskbb_event_after_post(post=self,
|
|
|
|
+ is_new=False)
|
|
return self
|
|
return self
|
|
|
|
|
|
# Adding a new post
|
|
# Adding a new post
|
|
@@ -234,6 +236,8 @@ class Post(HideableCRUDMixin, db.Model):
|
|
# And commit it!
|
|
# And commit it!
|
|
db.session.add(topic)
|
|
db.session.add(topic)
|
|
db.session.commit()
|
|
db.session.commit()
|
|
|
|
+ current_app.pluggy.hook.flaskbb_event_after_post(post=self,
|
|
|
|
+ is_new=True)
|
|
return self
|
|
return self
|
|
|
|
|
|
def delete(self):
|
|
def delete(self):
|