Spaces:
Runtime error
Runtime error
Update app/routes.py
Browse files- app/routes.py +15 -6
app/routes.py
CHANGED
|
@@ -339,13 +339,22 @@ def try_api():
|
|
| 339 |
)
|
| 340 |
|
| 341 |
if res.status_code != 200 or not res.json():
|
| 342 |
-
|
|
|
|
| 343 |
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
|
| 350 |
|
| 351 |
|
|
|
|
| 339 |
)
|
| 340 |
|
| 341 |
if res.status_code != 200 or not res.json():
|
| 342 |
+
flash("Invalid API key.")
|
| 343 |
+
return redirect(url_for('auth.docs'))
|
| 344 |
|
| 345 |
+
# Optional: Check file types
|
| 346 |
+
for resume in resumes:
|
| 347 |
+
if not allowed_file(resume.filename):
|
| 348 |
+
flash("Only PDF or DOCX resumes are allowed.")
|
| 349 |
+
return redirect(url_for('auth.docs'))
|
| 350 |
+
|
| 351 |
+
# Placeholder ranking logic
|
| 352 |
+
ranked = [resume.filename for resume in resumes]
|
| 353 |
+
|
| 354 |
+
return render_template('docs.html', response={
|
| 355 |
+
"job_description": job_description,
|
| 356 |
+
"ranked_resumes": ranked
|
| 357 |
+
})
|
| 358 |
|
| 359 |
|
| 360 |
|