Compare commits

...

2 Commits

Author SHA1 Message Date
81a052f94a Merge remote-tracking branch 'remotes/oficial/master' into patch-2 2019-12-18 16:13:59 +00:00
Dinis
3741fe4c66 initialize env with abspath
When running scripts, the path used is relative to the web2py root instead of the full path. This causes differences in migrations when using InDBMigrator - this causes pydal to try to repeat migrations already done.
2019-07-25 17:03:01 +01:00

View File

@@ -234,7 +234,7 @@ def run(
errmsg = 'invalid application name: %s' % appname
if not a:
die(errmsg, error_preamble=False)
adir = os.path.join('applications', a)
adir = os.path.absdir(os.path.join('applications', a))
if not os.path.exists(adir):
if not cron_job and not scheduler_job and \
@@ -273,7 +273,7 @@ def run(
if vars:
# underscore necessary because request.vars is a property
extra_request['_vars'] = vars
_env = env(a, c=c, f=f, import_models=import_models, extra_request=extra_request)
_env = env(a, c=c, f=f, import_models=import_models, extra_request=extra_request, dir=adir)
if c:
pyfile = os.path.join('applications', a, 'controllers', c + '.py')