File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -88,17 +88,19 @@ def get_url(self, item) -> dict:
8888
8989 if item .id is not None and item .__class__ ._meta .model_name != 'ticketcommentsolution' :
9090
91- urls .update ({
92- 'threads' : reverse (
93- 'API:_api_ticket_comment_base_sub_thread-list' ,
94- request = self ._context ['view' ].request ,
95- kwargs = {
96- 'ticket_id' : ticket_id ,
97- 'ticket_comment_model' : 'comment' ,
98- 'parent_id' : item .id
99- }
100- )
101- })
91+ if len (item .threads .all ()) > 1 : # Only present threads URL when there are threads.
92+
93+ urls .update ({
94+ 'threads' : reverse (
95+ 'API:_api_ticket_comment_base_sub_thread-list' ,
96+ request = self ._context ['view' ].request ,
97+ kwargs = {
98+ 'ticket_id' : ticket_id ,
99+ 'ticket_comment_model' : 'comment' ,
100+ 'parent_id' : item .id
101+ }
102+ )
103+ })
102104
103105 return urls
104106
You can’t perform that action at this time.
0 commit comments