File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1414
1515COMMENT_MAX_LENGTH = getattr (settings , 'COMMENT_MAX_LENGTH' , 3000 )
1616DEFAULT_COMMENTS_TIMEOUT = getattr (settings , 'COMMENTS_TIMEOUT' , (2 * 60 * 60 )) # 2h
17+ COMMENTS_FOR_CONCRETE_MODEL = getattr (settings , 'COMMENTS_FOR_CONCRETE_MODEL' , True )
1718
1819
1920class CommentSecurityForm (forms .Form ):
@@ -138,7 +139,10 @@ def get_comment_create_data(self, site_id=None):
138139 method to add extra fields onto a custom comment model.
139140 """
140141 return dict (
141- content_type = ContentType .objects .get_for_model (self .target_object ),
142+ content_type = ContentType .objects .get_for_model (
143+ self .target_object ,
144+ for_concrete_model = COMMENTS_FOR_CONCRETE_MODEL ,
145+ ),
142146 object_pk = force_str (self .target_object ._get_pk_val ()),
143147 user_name = self .cleaned_data ["name" ],
144148 user_email = self .cleaned_data ["email" ],
You can’t perform that action at this time.
0 commit comments