App crushed during a web2py upgrade

70 views
Skip to first unread message

mostwanted

unread,
Jun 11, 2022, 3:53:55 AM6/11/22
to web2py-users
I tried to upgrade my app to the latest version because the callback{{=A(link, callback=URL())}} functionality kept redirecting instead of calling the page to the current page div but it crushed!!!!

When i open my admin gape i get (Ticket issued: admin/41.77.89.202.2022-06-11.07-43-03.e76169bb-1516-4236-ab3b-6ee56ffdda39) which does not lead me anywhere, everytime i click on it it opens another page in another tab with the same ticket message, what can i do, please help me!!

mostwanted

unread,
Jun 11, 2022, 4:11:03 AM6/11/22
to web2py-users
I was able to resolve the problem, I reloaded the app from my pythonanywhere account and i was able to access my admin but i still can not get my callback to work as expected. Can someone please help me! What am i doing wrong or what do i need to do?!
It says my web2py is upgraded to 2.22.5-stable+timestamp

{{=A(company.no_of_ppadb_codes, _href='#', callback=URL('ppadb_codes.load', args=company.id), target="content", _class="show_codes")}}</strong><br /></span>
<div id="content"></div>

Regards

Dave S

unread,
Jun 11, 2022, 9:02:55 PM6/11/22
to web2py-users
On Saturday, June 11, 2022 at 1:11:03 AM UTC-7 mostwanted wrote:
I was able to resolve the problem, I reloaded the app from my pythonanywhere account and i was able to access my admin but i still can not get my callback to work as expected. Can someone please help me! What am i doing wrong or what do i need to do?!
It says my web2py is upgraded to 2.22.5-stable+timestamp

{{=A(company.no_of_ppadb_codes, _href='#', callback=URL('ppadb_codes.load', args=company.id), target="content", _class="show_codes")}}</strong><br /></span>
<div id="content"></div>



So now that you can read tickets again, what is the ticket for this one?

/dps

mostwanted

unread,
Jun 12, 2022, 1:04:09 AM6/12/22
to web2py-users
It says
<type 'exceptions.ImportError'> cannot import name prevent_open_redirect

under code listing it highlighted the line in red

import re
from gluon.admin import *
from gluon.fileutils import abspath, read_file, write_file
from gluon.utils import web2py_uuid
from gluon.tools import Config, prevent_open_redirect
from gluon.compileapp import find_exposed_functions
from glob import glob
from gluon._compat import iteritems, PY2, pickle, xrange, urlopen, to_bytes, StringIO, to_native, reload
import gluon.rewrite

Dave S

unread,
Jun 13, 2022, 5:49:16 PM6/13/22
to web2py-users
On Saturday, June 11, 2022 at 10:04:09 PM UTC-7 mostwanted wrote:
It says
<type 'exceptions.ImportError'> cannot import name prevent_open_redirect

under code listing it highlighted the line in red

import re
from gluon.admin import *
from gluon.fileutils import abspath, read_file, write_file
from gluon.utils import web2py_uuid
from gluon.tools import Config, prevent_open_redirect
from gluon.compileapp import find_exposed_functions
from glob import glob
from gluon._compat import iteritems, PY2, pickle, xrange, urlopen, to_bytes, StringIO, to_native, reload
import gluon.rewrite

Hmmm, I can find that function in the 2.22.3   version, so It's still around.  It will take someone with a more intimate understanding of the subsystem to explain the problem.

I do use a load() call in my apps, but the one I use the most loads a form.  It is not set up as a callback.

Dave S
/dps

Reply all
Reply to author
Forward
0 new messages