Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMMENTS_XTD_APP_MODEL_OPTIONS used on get_commentbox_props #422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mte90
Copy link

@Mte90 Mte90 commented Feb 7, 2024

In this way the settings parameter can overwrite the values for the specific model

In this way the settings parameter can overwrite the values for the specific model
@@ -143,6 +143,10 @@ def get_props(cls, obj, user, request=None):
d['like_url'] = reverse("comments-xtd-like", args=(0,))
d['dislike_url'] = reverse("comments-xtd-dislike", args=(0,))

defaults_per_model = settings.COMMENTS_XTD_APP_MODEL_OPTIONS[str(ctype).replace(' | ', '.')]
Copy link

@gamboz gamboz Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hit the same problem (see #423) and was looking at your MR that solves it 🙂

I think that on line 92 above, the options for the app model might have already been collected (options = get_app_model_options(content_type=ctype_key) so down here it could be sufficient to d.update(options).

See also l.100 "who_can_post": options['who_can_post'],.

However, I'm not sure if, at the moment, the function get_app_model_options() does the replace(' | ', '.') trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants