Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@custom_code.route('/view_data')
@myauth.requires_auth
def list_my_data():
users = Participant.query.all()
try:
return render_template('list.html', participants=users)
except TemplateNotFound:
abort(404)
@custom_code.route('/view_data')
@myauth.requires_auth
def list_my_data():
users = Participant.query.all()
try:
return render_template('list.html', participants=users)
except TemplateNotFound:
abort(404)
@custom_code.route('/view_data')
@myauth.requires_auth
def list_my_data():
users = Participant.query.all()
try:
return render_template('list.html', participants=users)
except TemplateNotFound:
abort(404)
def do_download_datafiles(self, _):
''' Download datafiles. '''
contents = {"trialdata": lambda p: p.get_trial_data(), "eventdata":
lambda p: p.get_event_data(), "questiondata": lambda p:
p.get_question_data()}
query = Participant.query.all()
for k in contents:
ret = "".join([contents[k](p) for p in query])
temp_file = open(k + '.csv', 'w')
temp_file.write(ret)
temp_file.close()