mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +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.
|
||||
* 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()`.
|
||||
* Only prompt about upgrades when running with a TTY.
|
||||
|
||||
|
||||
1.0.5 / 2017-10-25
|
||||
|
||||
@@ -17,7 +17,7 @@ if sys.version_info[0] < 3:
|
||||
reload(sys)
|
||||
sys.setdefaultencoding("utf-8")
|
||||
|
||||
__version__ = '1.1.0a1'
|
||||
__version__ = '1.1.0'
|
||||
|
||||
|
||||
class CTFdFlask(Flask):
|
||||
@@ -64,14 +64,17 @@ class ThemeLoader(FileSystemLoader):
|
||||
|
||||
|
||||
def confirm_upgrade():
|
||||
print("/*\\ CTFd has updated and must update the database! /*\\")
|
||||
print("/*\\ Please backup your database before proceeding! /*\\")
|
||||
print("/*\\ CTFd maintainers are not responsible for any data loss! /*\\")
|
||||
if input('Run database migrations (Y/N)').lower().strip() == 'y':
|
||||
return True
|
||||
if sys.stdin.isatty():
|
||||
print("/*\\ CTFd has updated and must update the database! /*\\")
|
||||
print("/*\\ Please backup your database before proceeding! /*\\")
|
||||
print("/*\\ CTFd maintainers are not responsible for any data loss! /*\\")
|
||||
if input('Run database migrations (Y/N)').lower().strip() == 'y':
|
||||
return True
|
||||
else:
|
||||
print('/*\\ Ignored database migrations... /*\\')
|
||||
return False
|
||||
else:
|
||||
print('/*\\ Ignored database migrations... /*\\')
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def run_upgrade():
|
||||
|
||||
Reference in New Issue
Block a user