Skip to content

Commit 3f96896

Browse files
committed
version 0.9.8 (#34)
1 parent 51ed970 commit 3f96896

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

app/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from app import consent, alert, experiment, complete, error
44
from .io import write_metadata
55
from .utils import gen_code
6-
__version__ = '0.9.7'
6+
__version__ = '0.9.8'
77

88
## Define root directory.
99
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
@@ -25,6 +25,11 @@
2525
msg = "WARNING: Flask password is currently default. This should be changed prior to production."
2626
warnings.warn(msg)
2727

28+
## Check Flask mode.
29+
if cfg['FLASK']['DEBUG'] != "FALSE":
30+
msg = "WARNING: Flask currently in debug mode. This should be changed prior to production."
31+
warnings.warn(msg)
32+
2833
## Initialize Flask application.
2934
app = Flask(__name__)
3035
app.secret_key = cfg['FLASK']['SECRET_KEY']
@@ -44,6 +49,7 @@ def index():
4449
session['data'] = data_dir
4550
session['metadata'] = meta_dir
4651
session['reject'] = reject_dir
52+
session['debug'] = cfg['FLASK']['DEBUG'] != "FALSE"
4753

4854
## Record incoming metadata.
4955
info = dict(

app/app.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[FLASK]
22
SECRET_KEY = PLEASE_CHANGE_THIS
3+
DEBUG = FALSE
34

45
[IO]
56
DATA = ../data

app/experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def experiment():
99
"""Present jsPsych experiment to participant."""
1010

1111
## Error-catching: screen for previous visits.
12-
if 'experiment' in session:
12+
if not session['debug'] and 'experiment' in session:
1313

1414
## Update participant metadata.
1515
session['ERROR'] = "1004: Revisited experiment."

0 commit comments

Comments
 (0)