gdritter repos bingo / 658ccd0
Redirect to the .pdf endpoing even if we keep the .svg endpoing Getty Ritter 6 years ago
1 changed file(s) with 1 addition(s) and 2 deletion(s). Collapse all Expand all
2828 raise Exception('No file uploaded!')
2929 choices = choices_from_excel(openpyxl.load_workbook(f.stream))
3030 choice_str = base64.urlsafe_b64encode('\x1c'.join(choices).encode('utf-8'))
31 return flask.redirect('/bingo.svg?choices={0}'.format(choice_str.decode('utf-8')))
31 return flask.redirect('/bingo.pdf?choices={0}'.format(choice_str.decode('utf-8')))
3232
3333
3434 @app.route('/bingo.svg')
3636 def generate():
3737 choice_str = base64.urlsafe_b64decode(flask.request.args.get('choices'))
3838 choices = choice_str.decode('utf-8').split('\x1c')
39 print(choices)
4039 return mk_svg(choices), 200, {'Content-Type': 'application/pdf'}
4140
4241