Compare commits

..

No commits in common. "a050a1eccf5ff8c2953e5c215853c997d8080b59" and "43cc0a56527559c7ef3e55b2ca7ae3822d64928b" have entirely different histories.

6 changed files with 11 additions and 8 deletions

View File

@ -77,7 +77,7 @@ $('.test-action').click(function(event) {
$.ajax({
url: `/admin/tests/edit/`,
type: 'POST',
data: JSON.stringify({'id': id, 'action': action}),
data: JSON.stringify({'id': id, 'action': action}), // TODO Change how CRUD operations work
contentType: 'application/json',
success: function(response) {
window.location.href = '/admin/tests/';

View File

@ -214,7 +214,7 @@ def _questions():
if form.validate_on_submit():
upload = form.data_file.data
if not check_is_json(upload): return jsonify({'error': 'Invalid file. Please upload a JSON file.'}), 400
if not validate_json(upload): return jsonify({'error': 'The data in the file is invalid.'}), 400
if not validate_json(upload): return jsonify({'error': 'The data in the file is invalid.'}), 400 # TODO Perhaps make a more complex validation script
new_dataset = Dataset()
success, message = new_dataset.create(
upload = upload,

View File

@ -28,10 +28,10 @@ class Config(object):
MAIL_SUPPRESS_SEND = False
MAIL_ASCII_ATTACHMENTS = bool(os.getenv('MAIL_ASCII_ATTACHMENTS'))
class Production(Config):
class ProductionConfig(Config):
pass
class Development(Config):
class DevelopmentConfig(Config):
APP_HOST = '127.0.0.1'
DEBUG = True
SESSION_COOKIE_SECURE = False
@ -39,7 +39,7 @@ class Development(Config):
MAIL_DEBUG = True
MAIL_SUPPRESS_SEND = False
class Testing(Development):
class TestingConfig(DevelopmentConfig):
TESTING = True
SESSION_COOKIE_SECURE = False
MAIL_SERVER = os.getenv('MAIL_SERVER')

View File

@ -1 +1 @@
from app.config import Development as Config
from app.config import DevelopmentConfig as Config

View File

@ -82,4 +82,5 @@ def create_app():
app = create_app()
if __name__ == '__main__': app.run()
if __name__ == '__main__':
app.run()

View File

@ -1,2 +1,4 @@
from main import app
if __name__ == '__main__': app.run()
if __name__ == '__main__':
app.run()