Fix bug with resume uploading
This commit is contained in:
parent
1eb15e7ead
commit
48271eb8c2
1 changed files with 2 additions and 6 deletions
|
@ -60,15 +60,10 @@ def root():
|
||||||
print("Someone visited!.")
|
print("Someone visited!.")
|
||||||
return render_template('index.html')
|
return render_template('index.html')
|
||||||
|
|
||||||
@app.route('/resumepost', method=['POST'])
|
@app.route('/resumepost', methods=['POST'])
|
||||||
def resumepost():
|
def resumepost():
|
||||||
"""A last minute hack to let people post their resume after they've already registered"""
|
"""A last minute hack to let people post their resume after they've already registered"""
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if not is_logged_in() or db.session.query(
|
|
||||||
db.exists().where(Hacker.mlh_id == session['mymlh']['id'])).scalar():
|
|
||||||
# Request flow == messed up somehow, restart them
|
|
||||||
return redirect(url_for('register'))
|
|
||||||
|
|
||||||
if 'resume' not in request.files:
|
if 'resume' not in request.files:
|
||||||
return "You tried to submit a resume with no file"
|
return "You tried to submit a resume with no file"
|
||||||
|
|
||||||
|
@ -88,6 +83,7 @@ def resumepost():
|
||||||
filename = secure_filename(filename)
|
filename = secure_filename(filename)
|
||||||
resume.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
|
resume.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
|
||||||
return "Resume uploaded!"
|
return "Resume uploaded!"
|
||||||
|
return "Something went wrong. If this keeps happening, slack message @bkayastha"
|
||||||
|
|
||||||
|
|
||||||
@app.route('/register', methods=['GET', 'POST'])
|
@app.route('/register', methods=['GET', 'POST'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue