Send a notification when a follow action happens
This commit is contained in:
		| @@ -24,6 +24,7 @@ from warnings import warn | ||||
| from flask_babelex import lazy_gettext | ||||
| from flask_security import UserMixin, RoleMixin | ||||
| from flask_sqlalchemy import SQLAlchemy | ||||
| from sqlalchemy.ext.hybrid import hybrid_property | ||||
| from sqlalchemy.orm.exc import NoResultFound | ||||
| from sqlalchemy_utils.types.choice import ChoiceType | ||||
|  | ||||
| @@ -519,6 +520,11 @@ class Notification(db.Model): | ||||
|  | ||||
|         return item_class.query.get(self.item_id) | ||||
|  | ||||
|     @item.setter | ||||
|     def item(self, value): | ||||
|         self.item_type = value.__class__.__name__ | ||||
|         self.item_id = value.id | ||||
|  | ||||
|     @property | ||||
|     def message(self): | ||||
|         """Get the translated message for ``key`` | ||||
|   | ||||
		Reference in New Issue
	
	Block a user