Modify

Opened 5 years ago

Closed 5 years ago

Last modified 2 years ago

#6322 closed defect (fixed)

[Patch] Fails when there's no priority

Reported by: root@… Owned by: 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 (0)

Change History (3)

comment:1 Changed 5 years ago 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))

comment:2 Changed 5 years ago by otaku42

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

comment:3 Changed 5 years ago by xpech

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from xpech. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.