Modify ↓
Opened 13 years ago
Last modified 13 years ago
#9237 new enhancement
if category is not set, use default category defined in trac.ini
Reported by: | falkb | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Component: | FullBlogPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
Usually, users forget to set a category when they post a new blog entry. This is bad since then it's not available or caught via the category survey.
This plugin could handle that by automatically setting a default category if none is set on posting. And I want to specify the default category in trac.ini.
Attachments (0)
Change History (2)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
This should work:
-
fullblogplugin/0.11/tracfullblog/model.py
501 501 fields['author'] = row[6] 502 502 fields['categories'] = row[7] 503 503 fields['category_list'] = set(_parse_categories(row[7])) 504 if (fields['categories'] == ''): 505 fields['categories'] = self.env.config.get('fullblog', 'default_categories') 506 fields['category_list'] = set(_parse_categories(fields['categories'])) 504 507 return fields 505 508 506 509 def _load_post(self, version=0):
Note: See
TracTickets for help on using
tickets.
Good idea. Could also be extended to include editing of this setting in Admin too.