Sfoglia il codice sorgente

[fb] Fix error when editing new file

Romain Rigaux 12 anni fa
parent
commit
6a1e98b

+ 2 - 0
apps/filebrowser/src/filebrowser/templates/fb_components.mako

@@ -114,6 +114,7 @@ from django.utils.translation import ugettext as _
        <li><a href="${url('filebrowser.views.view', path=dirname_enc)}"><i class="fa fa-file-text"></i> ${_('View file location')}</a></li>
        <li><a id="refreshBtn" href="#"><i class="fa fa-refresh"></i> ${_('Refresh')}</a></li>
 
+       % if stats is not None: # Case new file
        <li class="nav-header">${_('Info')}</li>
        <li class="white">
         <dl>
@@ -129,6 +130,7 @@ from django.utils.translation import ugettext as _
           <dd>${stringformat(stats['mode'], "o")}</dd>
         </dl>
        </li>
+       % endif
     </ul>
   </div>
 </%def>

+ 1 - 5
apps/filebrowser/src/filebrowser/views_test.py

@@ -16,11 +16,7 @@
 # limitations under the License.
 #!/usr/bin/env python
 
-try:
-  import json
-except ImportError:
-  import simplejson as json
-
+import json
 import logging
 import os
 import re