File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed
Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -97,25 +97,18 @@ def image_alternate_url(self):
9797 @property
9898 def has_ticketing_support (self ):
9999 """Return boolean if a product has Zendesk ticketing support"""
100- try :
101- config = self .support_configs .get (is_active = True )
102- except ProductSupportConfig .DoesNotExist :
103- return False
104- else :
105- return config .enable_zendesk_support
100+ return self .support_configs .filter (
101+ is_active = True ,
102+ zendesk_config__isnull = False ,
103+ ).exists ()
106104
107105 def questions_enabled (self , locale ):
108106 """Check if product has an active public forum in the given locale."""
109- try :
110- config = self .support_configs .get (is_active = True )
111- except ProductSupportConfig .DoesNotExist :
112- return False
113-
114- return (
115- config .forum_config
116- and config .forum_config .is_active
117- and config .forum_config .enabled_locales .filter (locale = locale ).exists ()
118- )
107+ return self .support_configs .filter (
108+ is_active = True ,
109+ forum_config__is_active = True ,
110+ forum_config__enabled_locales__locale = locale ,
111+ ).exists ()
119112
120113 def get_absolute_url (self ):
121114 return reverse ("products.product" , kwargs = {"slug" : self .slug })
You can’t perform that action at this time.
0 commit comments