Modify

Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#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 8 years ago by Al Nikolov

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 8 years ago by Michael Renzmann

Summary: Fails when there's no priority[Patch] Fails when there's no priority

comment:3 Changed 8 years ago by Xavier Pechoultres

Resolution: fixed
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Xavier Pechoultres.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.