Commits

Ezio Melotti committed 6d5ba69

#538: replace more error_message.append with add_error_message.

Comments (0)

Files changed (2)

extensions/create_patch.py

         if self.classname != 'issue':
             raise Reject, "create_patch is only useful for issues"
         if not self.form.has_key('@repo'):
-            self.client.error_message.append('hgrepo missing')
+            self.client.add_error_message('hgrepo missing')
             return
         repo = self.form['@repo'].value
         url = db.hgrepo.get(repo, 'url')
         if not url:
-            self.client.error_message.append('unknown hgrepo url')
+            self.client.add_error_message('unknown hgrepo url')
             return
         lastrev = db.hgrepo.get(repo, 'lastrev')
         patchbranch = db.hgrepo.get(repo, 'patchbranch')
         try:
             diff, head = download_patch(url, lastrev, patchbranch)
         except NotChanged:
-            self.client.error_message.append('%s.diff is already available' % lastrev)
+            self.client.add_error_message('%s.diff is already available' % lastrev)
             return
         except Exception, e:
-            self.client.error_message.append(str(e))
+            self.client.add_error_message(str(e))
             return
         fileid = db.file.create(name='%s.diff' % head,
                                 type='text/plain',

extensions/openid_login.py

     'Login action with provider-guided login'
     def handle(self):
         if 'provider' not in self.form:
-            self.client.error_message.append(self._('Provider name required'))
+            self.client.add_error_message(self._('Provider name required'))
             return
         provider = self.form['provider'].value
         if provider not in providers:
-            self.client.error_message.append(self._('Unsupported provider'))
+            self.client.add_error_message(self._('Unsupported provider'))
             return
         provider_id = providers[provider][2]
         # For most providers, it would be reasonable to cache the discovery
         except Exception:
             result = None
         if result is None:
-            self.client.error_message.append('Provider %s appears to be down' % providers[provider][0])
+            self.client.add_error_message('Provider %s appears to be down' % providers[provider][0])
             return
         services, op_endpoint, op_local = result
         session = self.get_session(op_endpoint, services)
 class OpenidDelete(Action):
     def handle(self):
         if not self.form.has_key('openid'):
-            self.client.error_message.append('OpenID required')
+            self.client.add_error_message('OpenID required')
             return
         ID = self.form['openid'].value
         openids = self.db.user.get(self.userid, 'openids')