Explorar el Código

HUE-1593 [jobbrowser] Exception when user is not allowed to view a job of another user

Mainly when resolving whether config should link to FileBrowser or FileViewer.
Abraham Elmahrek hace 12 años
padre
commit
23009b0
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      apps/jobbrowser/src/jobbrowser/templates/job.mako

+ 5 - 0
apps/jobbrowser/src/jobbrowser/templates/job.mako

@@ -18,6 +18,7 @@
 
 <%!
   import os
+  from hadoop.fs.exceptions import WebHdfsException
   from jobbrowser.views import format_counter_name
   from filebrowser.views import location_to_url
   from desktop.views import commonheader, commonfooter
@@ -72,10 +73,14 @@
             %>
             % if is_hdfs_uri:
                 <%
+                  try:
                     if request.fs.isfile(url_splitted[2]):
                       target = "FileViewer"
                     else:
                       target = "FileBrowser"
+                  except WebHdfsException, e:
+                    # Permissions error... see HUE-1593
+                    target = "FileBrowser"
                 %>
                     <a href="${location_to_url(val)}" title="${val}" target="${target}">${val}</a>
                 % if i != len(splitArray) - 1: