Ticket #6436: cache-get_ticket_fields-r6792.diff
| File cache-get_ticket_fields-r6792.diff, 1.0 kB (added by cboos, 5 months ago) |
|---|
-
trac/ticket/api.py
177 177 178 178 def get_ticket_fields(self): 179 179 """Returns the list of fields available for tickets.""" 180 # This is now cached - as it makes quite a number of things faster, 181 # e.g. #6436 182 if self._fields is None: 183 self._fields = self._get_ticket_fields() 184 return self._fields 185 186 _fields = None 187 def _get_ticket_fields(self): 180 188 from trac.ticket import model 181 189 182 190 db = self.env.get_db_cnx() … … 248 256 return fields 249 257 250 258 def get_custom_fields(self): 259 if self._custom_fields is None: 260 self._custom_fields = self._get_custom_fields() 261 return self._custom_fields 262 263 _custom_fields = None 264 def _get_custom_fields(self): 251 265 fields = [] 252 266 config = self.config['ticket-custom'] 253 267 for name in [option for option, value in config.options()
