Modify ↓
#6322 closed defect (fixed)
[Patch] Fails when there's no priority
| Reported by: | Al Nikolov | Owned by: | Xavier Pechoultres |
|---|---|---|---|
| Priority: | normal | Component: | IcalViewPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.11 |
Description
If priority is disabled by the admin, tickets have priority='--'. The plugin fails then witn KeyError: '--'
Attachments (0)
Change History (3)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
| Summary: | Fails when there's no priority → [Patch] Fails when there's no priority |
|---|
comment:3 Changed 16 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note: See
TracTickets for help on using
tickets.



patch:
Index: icalview/icalview.py =================================================================== --- icalview/icalview.py (revision 7247) +++ icalview/icalview.py (working copy) @@ -191,7 +192,10 @@ if "HTTPS" in os.getenv('SERVER_PROTOCOL') : protocol = "https" content.write("URL:%s://%s%s\r\n" % (protocol,os.getenv('SERVER_NAME'),get_resource_url(self.env,ticket,req.href))) - priority = priority_map[result['priority']] + try: + priority = priority_map[result['priority']] + except: + self.env.log.debug("unmapped priority %s" % result['priority']) if priority != None: content.write("PRIORITY;VALUE=%s:%d\r\n" % (result['priority'],priority))