diff --git a/trac/ticket/model.py b/trac/ticket/model.py
--- a/trac/ticket/model.py
+++ b/trac/ticket/model.py
@@ -45,7 +45,7 @@
     # 0.11 compatibility
     time_created = property(lambda self: self.values.get('time'))
     time_changed = property(lambda self: self.values.get('changetime'))
-    
+
     def __init__(self, env, tkt_id=None, db=None, version=None):
         self.env = env
         if tkt_id is not None:
@@ -159,7 +159,7 @@
                 return field[0].get('value', '')
         except KeyError:
             pass
-        
+
     def populate(self, values):
         """Populate the ticket with 'suitable' values from a dictionary"""
         field_names = [f['name'] for f in self.fields]
@@ -174,7 +174,7 @@
 
     def insert(self, when=None, db=None):
         """Add ticket to database.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert not self.exists, 'Cannot insert an existing ticket'
@@ -199,7 +199,7 @@
         for field in self.time_fields:
             if field in values:
                 values[field] = to_utimestamp(values[field])
-        
+
         # Insert ticket record
         tkt_id = [None]
         @self.env.with_transaction(db)
@@ -231,7 +231,7 @@
         Store ticket changes in the database. The ticket must already exist in
         the database.  Returns False if there were no changes to save, True
         otherwise.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert self.exists, 'Cannot update a new ticket'
@@ -322,7 +322,7 @@
                     VALUES (%s, %s, %s, %s, %s, %s)
                     """, (self.id, when_ts, author, name, self._old[name],
                           self[name]))
-            
+
             # always save comment, even if empty 
             # (numbering support for timeline)
             cursor.execute("""
@@ -330,7 +330,7 @@
                     (ticket,time,author,field,oldvalue,newvalue)
                 VALUES (%s,%s,%s,'comment',%s,%s)
                 """, (self.id, when_ts, author, comment_num, comment))
-    
+
             cursor.execute("UPDATE ticket SET changetime=%s WHERE id=%s",
                            (when_ts, self.id))
 
@@ -369,7 +369,7 @@
         else:
             cursor.execute("""
                 SELECT time,author,field,oldvalue,newvalue, 1 AS permanent
-                FROM ticket_change WHERE ticket=%s
+                FROM ticket_change WHERE ticket=%s 
                   UNION 
                 SELECT time,author,'attachment',null,filename, 0 AS permanent
                 FROM attachment WHERE id=%s 
@@ -386,7 +386,7 @@
 
     def delete(self, db=None):
         """Delete the ticket.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         @self.env.with_transaction(db)
@@ -429,7 +429,7 @@
             if not row:
                 return
             ts = row[0]
-            
+
             # Find modified fields and their previous value
             cursor.execute("""
                 SELECT field, oldvalue, newvalue FROM ticket_change
@@ -464,12 +464,12 @@
                         cursor.execute("""
                             UPDATE ticket SET %s=%%s WHERE id=%%s
                             """ % field, (oldvalue, self.id))
-            
+
             # Delete the change
             cursor.execute("""
                 DELETE FROM ticket_change WHERE ticket=%s AND time=%s
                 """, (self.id, ts))
-            
+
             # Fix the last modification time
             cursor.execute("""
                 UPDATE ticket SET changetime=(
@@ -477,7 +477,7 @@
                     ORDER BY time DESC LIMIT 1)
                 WHERE id=%s
                 """, (self.id, self.id))
-        
+
         self._fetch_ticket(self.id)
 
     def modify_comment(self, cdate, author, comment, when=None):
@@ -502,7 +502,7 @@
                 break
             if comment == (old_comment or ''):
                 return
-        
+
             # Comment history is stored in fields named "_comment%d"
             # Find the next edit number
             cursor.execute("""
@@ -579,7 +579,7 @@
                               '%' + db.like_escape('.' + scnum)))
         for row in cursor:
             return row
-        
+
         # Fallback when comment number is not available in oldvalue
         num = 0
         cursor.execute("""
@@ -604,7 +604,7 @@
                 break
         else:
             return
-        
+
         # Find author if NULL
         if author is None:
             cursor.execute("""
@@ -616,7 +616,6 @@
                 break
         return (ts, author, comment)
 
-
 def simplify_whitespace(name):
     """Strip spaces and remove duplicate spaces within names"""
     if name:
@@ -653,7 +652,7 @@
 
     def delete(self, db=None):
         """Delete the enum value.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert self.exists, 'Cannot delete non-existent %s' % self.type
@@ -679,7 +678,7 @@
 
     def insert(self, db=None):
         """Add a new enum value.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert not self.exists, 'Cannot insert existing %s' % self.type
@@ -706,7 +705,7 @@
 
     def update(self, db=None):
         """Update the enum value.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert self.exists, 'Cannot update non-existent %s' % self.type
@@ -778,7 +777,6 @@
 
 
 class Component(object):
-
     def __init__(self, env, name=None, db=None):
         self.env = env
         name = simplify_whitespace(name)
@@ -805,7 +803,7 @@
 
     def delete(self, db=None):
         """Delete the component.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert self.exists, 'Cannot delete non-existent component'
@@ -820,7 +818,7 @@
 
     def insert(self, db=None):
         """Insert a new component.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert not self.exists, 'Cannot insert existing component'
@@ -841,7 +839,7 @@
 
     def update(self, db=None):
         """Update the component.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert self.exists, 'Cannot update non-existent component'
@@ -882,7 +880,6 @@
 
 
 class Milestone(object):
-
     def __init__(self, env, name=None, db=None):
         self.env = env
         name = simplify_whitespace(name)
@@ -932,7 +929,7 @@
 
     def delete(self, retarget_to=None, author=None, db=None):
         """Delete the milestone.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         @self.env.with_transaction(db)
@@ -959,7 +956,7 @@
 
     def insert(self, db=None):
         """Insert a new milestone.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         self.name = simplify_whitespace(self.name)
@@ -983,7 +980,7 @@
 
     def update(self, db=None):
         """Update the milestone.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         self.name = simplify_whitespace(self.name)
@@ -1051,7 +1048,6 @@
 
 
 class Version(object):
-
     def __init__(self, env, name=None, db=None):
         self.env = env
         name = simplify_whitespace(name)
@@ -1078,7 +1074,7 @@
 
     def delete(self, db=None):
         """Delete the version.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert self.exists, 'Cannot delete non-existent version'
@@ -1093,7 +1089,7 @@
 
     def insert(self, db=None):
         """Insert a new version.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert not self.exists, 'Cannot insert existing version'
@@ -1113,7 +1109,7 @@
 
     def update(self, db=None):
         """Update the version.
-        
+
         The `db` argument is deprecated in favor of `with_transaction()`.
         """
         assert self.exists, 'Cannot update non-existent version'

