[PATCH 4 of 6] lib: BaseRepoController: use webob.exc.HTTPNotFound if possible

Thomas De Schampheleire patrickdepinguin at gmail.com
Sat Dec 29 21:50:18 UTC 2018


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1546117359 -3600
#      Sat Dec 29 22:02:39 2018 +0100
# Node ID 395330be823c7d01a1890a26decfb4f14368c4a4
# Parent  60672272cef36dd45594b607036fb5d7eda5b15c
lib: BaseRepoController: use webob.exc.HTTPNotFound if possible

In the entire code base, the use of 'paste' is very limited.
In particular, 'paste.httpexceptions' is only still used in lib/base.py, in
three occurrences:
- two of them in class BasicAuth which derives from paste.auth.something.
  Here it probably makes sense to use paste.httpexceptions.
- one in BaseRepoController, which has no specific relation to paste. This
  occurrence can be replaced with webob.exc like in the rest of the code
  base.

diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py
--- a/kallithea/lib/base.py
+++ b/kallithea/lib/base.py
@@ -582,7 +582,7 @@ class BaseRepoController(BaseController)
                 from kallithea.lib import helpers as h
                 h.flash(h.literal(_('Repository not found in the filesystem')),
                         category='error')
-                raise paste.httpexceptions.HTTPNotFound()
+                raise webob.exc.HTTPNotFound()
 
             # some globals counter for menu
             c.repository_followers = self.scm_model.get_followers(dbr)


More information about the kallithea-general mailing list