Minor issue when trying to download plugins from admin application

24 views
Skip to first unread message

Michel Krav

unread,
Mar 28, 2015, 12:14:44 PM3/28/15
to web...@googlegroups.com
Hi,

I'm facing a minor issue when trying to install ckeditor plugin , so I report it :

When using Download plugins from repository button in the admin application interface as I cannot access the url web2slices.com the exception is caught and the following happen :

Version
web2py™     Version 2.9.12-stable+timestamp.2015.01.17.06.11.03
Python     Python 2.7.8: C:\Python27\python.exe (prefix: C:\Python27)

Traceback (most recent call last):
  File "D:\Python\web2py_src\web2py\gluon\restricted.py", line 224, in restricted
    exec ccode in environment
  File "D:/Python/web2py_src/web2py/applications/admin/controllers/default.py", line 1945, in <module>
  File "D:\Python\web2py_src\web2py\gluon\globals.py", line 393, in <lambda>
    self._caller = lambda f: f()
  File "D:/Python/web2py_src/web2py/applications/admin/controllers/default.py", line 1919, in plugins
    return dict(plugins=session.plugins["results"], app=request.args(0))
TypeError: list indices must be integers, not str


<type 'exceptions.TypeError'>(list indices must be integers, not str)

This is the original code :
def plugins():
    app
= request.args(0)
   
from serializers import loads_json
   
if not session.plugins:
       
try:
            rawlist
= urllib.urlopen("http://www.web2pyslices.com/" +
                                     
"public/api.json/action/list/content/Package?package" +
                                     
"_type=plugin&search_index=false").read()
            session
.plugins = loads_json(rawlist)
       
except:
            response
.flash = T('Unable to download the list of plugins')
            session
.plugins = []
   
return dict(plugins=session.plugins["results"], app=request.args(0))




So I propose to replace line 1918 :
session.plugins = []


by :
session.plugins = {"results" : None}



Thanks for web2py !
Reply all
Reply to author
Forward
0 new messages