Fix invoke pty error when running 'invoke superuser'

This commit is contained in:
Ben Charlton 2020-08-28 20:38:16 +01:00
parent 2c1d585f8b
commit 07f7b46a8a

View File

@ -47,7 +47,7 @@ def managePyPath():
return os.path.join(managePyDir(), 'manage.py')
def manage(c, cmd):
def manage(c, cmd, pty=False):
"""
Runs a given command against django's "manage.py" script.
@ -59,7 +59,7 @@ def manage(c, cmd):
c.run('cd {path} && python3 manage.py {cmd}'.format(
path=managePyDir(),
cmd=cmd
))
), pty=pty)
@task(help={'length': 'Length of secret key (default=50)'})
def key(c, length=50, force=False):
@ -106,7 +106,7 @@ def superuser(c):
Create a superuser (admin) account for the database.
"""
manage(c, 'createsuperuser')
manage(c, 'createsuperuser', pty=True)
@task
def migrate(c):