rblank  committed 60b8fb5

0.12.1dev: In the `AuthzSourcePolicy`, allow access to invalid repositories (and in particular, avoid raising an exception) so that the error message can be displayed in the repository index.

Discussed in #9661.

  • Participants
  • Parent commits 5af7d81
  • Branches 0.12-stable

Comments (0)

Files changed (2)

File trac/versioncontrol/

                 return users & set(usernames) and True or None
             rm = RepositoryManager(self.env)
-            repos = rm.get_repository(
+            try:
+                repos = rm.get_repository(
+            except TracError:
+                return True # Allow error to be displayed in the repo index
             modules = [ or self.authz_module_name]
             if modules[0]:

File trac/versioncontrol/templates/repository_index.html

             <em py:strip="not err">
               <b py:strip="repoinfo.alias != ''">
                 <a class="dir" title="View Root Directory"
-                  href="${href.browser(repos.reponame, order=(order != 'name' and order or None), desc=desc)}">$reponame</a>
+                  href="${href.browser((repos and (repos.reponame,) or (reponame,))[0],
+                                       order=(order != 'name' and order or None), desc=desc)}">$reponame</a>