mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 06:24:23 +01:00
Only prompt for upgrades if there's a TTY & mark 1.1.0 (#537)
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
* SMTP email connections take priority over mailgun settings now. The opposite used to be true.
|
* SMTP email connections take priority over mailgun settings now. The opposite used to be true.
|
||||||
* The JavaScript `submitkey()` function now takes an optional callback.
|
* The JavaScript `submitkey()` function now takes an optional callback.
|
||||||
* `utils.get_config()` no longer looks at `app.config` values. Instead use `utils.get_app_config()`.
|
* `utils.get_config()` no longer looks at `app.config` values. Instead use `utils.get_app_config()`.
|
||||||
|
* Only prompt about upgrades when running with a TTY.
|
||||||
|
|
||||||
|
|
||||||
1.0.5 / 2017-10-25
|
1.0.5 / 2017-10-25
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if sys.version_info[0] < 3:
|
|||||||
reload(sys)
|
reload(sys)
|
||||||
sys.setdefaultencoding("utf-8")
|
sys.setdefaultencoding("utf-8")
|
||||||
|
|
||||||
__version__ = '1.1.0a1'
|
__version__ = '1.1.0'
|
||||||
|
|
||||||
|
|
||||||
class CTFdFlask(Flask):
|
class CTFdFlask(Flask):
|
||||||
@@ -64,14 +64,17 @@ class ThemeLoader(FileSystemLoader):
|
|||||||
|
|
||||||
|
|
||||||
def confirm_upgrade():
|
def confirm_upgrade():
|
||||||
print("/*\\ CTFd has updated and must update the database! /*\\")
|
if sys.stdin.isatty():
|
||||||
print("/*\\ Please backup your database before proceeding! /*\\")
|
print("/*\\ CTFd has updated and must update the database! /*\\")
|
||||||
print("/*\\ CTFd maintainers are not responsible for any data loss! /*\\")
|
print("/*\\ Please backup your database before proceeding! /*\\")
|
||||||
if input('Run database migrations (Y/N)').lower().strip() == 'y':
|
print("/*\\ CTFd maintainers are not responsible for any data loss! /*\\")
|
||||||
return True
|
if input('Run database migrations (Y/N)').lower().strip() == 'y':
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print('/*\\ Ignored database migrations... /*\\')
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
print('/*\\ Ignored database migrations... /*\\')
|
return True
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def run_upgrade():
|
def run_upgrade():
|
||||||
|
|||||||
Reference in New Issue
Block a user