Closed philgyford closed 1 year ago
This is intended behaviour but I'm happy to add a setting to disable it.
The behaviour you expected was how it worked originally. I enabled model-less mentions soon after (1.something
) so that pages like a root homepage (that don't necessarily map to any particular model instance) could be mentioned.
The name of MentionableMixin
and the readme still somewhat imply that it is a requirement so sorry for the confusion. I'm planning to fill out the wiki to make the various workings of the library less cryptic in general.
Ah, that makes sense. I did only expect objects that are "Mentionable", and have their URL set up appropriately, to be able to receive mentions.
I probably wouldn't have thought much of it now, except I had some code that started throwing errors – an RSS feed of mentions that expected the presence of a target_object
, which I also expected to always be a Post
. For now I can make it just ignore any mentions that don't have a target_object
.
You can now (3.1.0
) use settings.WEBMENTIONS_INCOMING_TARGET_MODEL_REQUIRED = True
to ignore any incoming mentions that do not resolve to a model instance.
This is great! Thank you so much for this. It seems to work perfectly.
If I link to a page on my own site that doesn't represent an object with
MentionableMixin
then it registers a mention to that URL. This results in a Webmention object that has notarget_object
etc.For example, on this page representing a
Post
(the only model on the site that hasMentionableMixin
) I link to this page https://www.gyford.com/phil/creators/8kk28/ . This results in these Webmentions:With the relevant one like this:
I'm not sure why this happens, given the target URL (
/phil/creators/8kk28/
) doesn't match the URL of the onlyMentionableMixin
model?