1. Alex Willmer
  2. trac-ticketlinks

Commits

cboos  committed b3b1a81

Ported [4160] to 0.10-stable (''#3839 improved authentication missing error message'')

  • Participants
  • Parent commits ef928a5
  • Branches 0.10-stable

Comments (0)

Files changed (2)

File trac/util/html.py

View file
  • Ignore whitespace
 
 class Tags(object):
 
+    def __call__(self, *args):
+        return Fragment()(*args)
+
     def __getattribute__(self, name):
         return Element(name.lower())
 

File trac/web/auth.py

View file
  • Ignore whitespace
         problems on installations authenticating against Windows which is not
         case sensitive regarding user names and domain names
         """
-        assert req.remote_user, 'Authentication information not available.'
-
+        if not req.remote_user:
+            raise TracError(html("Authentication information not available. "
+                                 "Please refer to the ",
+                                 html.a('installation documentation',
+                                        title="Configuring Authentication",
+                                        href=req.href.wiki('TracInstall') +
+                                        "#ConfiguringAuthentication"), "."))
         remote_user = req.remote_user
         if self.ignore_case:
             remote_user = remote_user.lower()