diff --git a/ref-test/app/admin/static/js/script.js b/ref-test/app/admin/static/js/script.js index 30c8a49..96004f9 100644 --- a/ref-test/app/admin/static/js/script.js +++ b/ref-test/app/admin/static/js/script.js @@ -77,7 +77,7 @@ $('.test-action').click(function(event) { $.ajax({ url: `/admin/tests/edit/`, type: 'POST', - data: JSON.stringify({'id': id, 'action': action}), // TODO Change how CRUD operations work + data: JSON.stringify({'id': id, 'action': action}), contentType: 'application/json', success: function(response) { window.location.href = '/admin/tests/'; diff --git a/ref-test/app/admin/views.py b/ref-test/app/admin/views.py index 65bb6f2..cfea08f 100644 --- a/ref-test/app/admin/views.py +++ b/ref-test/app/admin/views.py @@ -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 # TODO Perhaps make a more complex validation script + if not validate_json(upload): return jsonify({'error': 'The data in the file is invalid.'}), 400 new_dataset = Dataset() success, message = new_dataset.create( upload = upload, diff --git a/ref-test/app/config.py b/ref-test/app/config.py index b70db97..e62ead5 100644 --- a/ref-test/app/config.py +++ b/ref-test/app/config.py @@ -28,10 +28,10 @@ class Config(object): MAIL_SUPPRESS_SEND = False MAIL_ASCII_ATTACHMENTS = bool(os.getenv('MAIL_ASCII_ATTACHMENTS')) -class ProductionConfig(Config): +class Production(Config): pass -class DevelopmentConfig(Config): +class Development(Config): APP_HOST = '127.0.0.1' DEBUG = True SESSION_COOKIE_SECURE = False @@ -39,7 +39,7 @@ class DevelopmentConfig(Config): MAIL_DEBUG = True MAIL_SUPPRESS_SEND = False -class TestingConfig(DevelopmentConfig): +class Testing(Development): TESTING = True SESSION_COOKIE_SECURE = False MAIL_SERVER = os.getenv('MAIL_SERVER') diff --git a/ref-test/config.py b/ref-test/config.py index 38a499a..3ad3337 100644 --- a/ref-test/config.py +++ b/ref-test/config.py @@ -1 +1 @@ -from app.config import DevelopmentConfig as Config \ No newline at end of file +from app.config import Development as Config diff --git a/ref-test/main.py b/ref-test/main.py index e97c9e1..88290e5 100644 --- a/ref-test/main.py +++ b/ref-test/main.py @@ -82,5 +82,4 @@ def create_app(): app = create_app() -if __name__ == '__main__': - app.run() \ No newline at end of file +if __name__ == '__main__': app.run() \ No newline at end of file diff --git a/ref-test/wsgi.py b/ref-test/wsgi.py index b9a49b9..b7bcfb6 100644 --- a/ref-test/wsgi.py +++ b/ref-test/wsgi.py @@ -1,4 +1,2 @@ from main import app - -if __name__ == '__main__': - app.run() \ No newline at end of file +if __name__ == '__main__': app.run() \ No newline at end of file