Ticket #6322 (closed defect: fixed)

Opened 3 years ago

Last modified 1 year ago

[Patch] Fails when there's no priority

Reported by: root@toor.spb.ru Assigned to: xpech
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

Change History

12/13/09 23:24:17 changed by clown

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))

12/14/09 06:02:41 changed by otaku42

  • summary changed from Fails when there's no priority to [Patch] Fails when there's no priority.

12/14/09 08:45:00 changed by xpech

  • status changed from new to closed.
  • resolution set to fixed.

(In [7250]) fix #6322 : unmapped priority cause exception. Many thanks to clown for patching


Add/Change #6322 ([Patch] Fails when there's no priority)




Change Properties
Action