You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've added MentionableMixin to a Post model, that has statuses of "Draft" and "Published", and I'm trying to work out how I can ensure that webmentions are only sent when a Post object's saved and it's in "Published" state. At the moment, overriding the save() method, I can't figure out a way to do it.
My initial thought is to give MentionableMixin a get_allow_outgoing_webmentions() method that, by default, just returns the value of allow_outgoing_webmentions. Child classes could override this with something like:
I've added
MentionableMixin
to aPost
model, that has statuses of "Draft" and "Published", and I'm trying to work out how I can ensure that webmentions are only sent when aPost
object's saved and it's in "Published" state. At the moment, overriding thesave()
method, I can't figure out a way to do it.My initial thought is to give
MentionableMixin
aget_allow_outgoing_webmentions()
method that, by default, just returns the value ofallow_outgoing_webmentions
. Child classes could override this with something like:Then the existing
MentionableMixin.save()
method could check that instead ofallow_outgoing_webmentions
before handling them.I guess add a matching
get_allow_incoming_webmentions()
method for completeness too.The text was updated successfully, but these errors were encountered: