[Python-checkins] r70541 - tracker/roundup-src/roundup/cgi/templating.py

martin.v.loewis python-checkins at python.org
Mon Mar 23 08:13:42 CET 2009


Author: martin.v.loewis
Date: Mon Mar 23 08:13:42 2009
New Revision: 70541

Log:
Fix previous checkin: only check properties if a classname
was given.


Modified:
   tracker/roundup-src/roundup/cgi/templating.py

Modified: tracker/roundup-src/roundup/cgi/templating.py
==============================================================================
--- tracker/roundup-src/roundup/cgi/templating.py	(original)
+++ tracker/roundup-src/roundup/cgi/templating.py	Mon Mar 23 08:13:42 2009
@@ -2332,7 +2332,9 @@
                     dirs.append(self.form.getfirst(dirkey))
             if fields: # only try other special char if nothing found
                 break
-        cls = self.client.db.getclass(self.classname)
+        cls = None
+        if self.classname:
+            cls = self.client.db.getclass(self.classname)
         for f, d in map(None, fields, dirs):
             if f.startswith('-'):
                 dir, name = '-', f[1:]
@@ -2340,7 +2342,7 @@
                 dir, name = '-', f
             else:
                 dir, name = '+', f
-            if cls.get_transitive_prop(name) is None:
+            if cls and cls.get_transitive_prop(name) is None:
                 self.client.error_message.append("Unknown property "+name)
             else:
                 var.append((dir, name))


More information about the Python-checkins mailing list