Changeset 4792

Show
Ignore:
Timestamp:
11/13/08 11:55:56 (2 months ago)
Author:
martin_s
Message:
tracwikicss/plugin.py
Changed exception handling due to problems. Thanks goes
to user olistudent for pointing out the neccessary changes. See ticket #4070.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wikicssplugin/0.11/tracwikicss/plugin.py

    r4786 r4792  
    4444            db = self.env.get_db_cnx() 
    4545            cursor = db.cursor() 
    46             cursor.execute("SELECT text, MAX(version) FROM wiki WHERE name='%s';" % self.wikipage) 
    47             content = cursor.fetchone()[0] 
    48             if content is None: 
     46            cursor.execute( \ 
     47                "SELECT text, MAX(version) FROM wiki WHERE name='%s' " \ 
     48                "GROUP BY text;" % self.wikipage ) 
     49            content = cursor.fetchone() 
     50            if not content: 
    4951                raise Exception("WikiCss: Configured wiki page '%s' doesn't exits." % self.wikipage) 
    50             req.send(content, content_type='text/css', status=200) 
    51         except e: 
     52            req.send(content[0], content_type='text/css', status=200) 
     53        except RequestDone: 
     54            pass 
     55        except Exception, e: 
    5256            self.log.error(e) 
    5357            req.send_response(404)