Commits

Mike Bayer committed 13d19f9

fix...again...

  • Participants
  • Parent commits 864af4e

Comments (0)

Files changed (1)

tracvatar/web_ui.py

     _long_author_re = re.compile(r'.*<([^@]+)@([^@]+)>\s*|([^@]+)@([^@]+)')
 
     def _lookup_email(self, author_data):
-        if not author_data:
-            return
-
         lookup_authors = sorted([a for a in author_data if '@' not in a])
-        db = self.env.get_db_cnx()
-        cursor = db.cursor()
-        cursor.execute(
-            "select sid, value from session_attribute where name=%%s and sid in (%s)" % (
-                ",".join(["%s" for author in lookup_authors])
-            ), ("email",) + tuple(lookup_authors)
-        )
-        for sid, email in cursor.fetchall():
-            author_data[sid] = hashlib.md5(email.lower()).hexdigest()
+        if lookup_authors:
+            db = self.env.get_db_cnx()
+            cursor = db.cursor()
+            cursor.execute(
+                "select sid, value from session_attribute where name=%%s and sid in (%s)" % (
+                    ",".join(["%s" for author in lookup_authors])
+                ), ("email",) + tuple(lookup_authors)
+            )
+            for sid, email in cursor.fetchall():
+                author_data[sid] = hashlib.md5(email.lower()).hexdigest()
 
         for author in set(author_data).difference(lookup_authors):
             author_info = self._long_author_re.match(author)