Skip to content

Commit

Permalink
Chnaged forms to params
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamgutgutia committed Dec 17, 2023
1 parent c536e12 commit a5d6df4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
baseDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

def template():
if request.form.get("filetype","") == "xlsx":
if request.args.get("filetype","") == "xlsx":
filePath = os.path.join(baseDir, 'files', 'Template - Excel Workbook.xlsx')
return send_file(
filePath,
mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
as_attachment=True,
download_name="Template - Excel Workbook.xlsx"
),200
elif request.form.get("filetype","") == "xls":
elif request.args.get("filetype","") == "xls":
filePath = os.path.join(baseDir, 'files', 'Template - Excel.xls')
return send_file(
filePath,
Expand All @@ -21,7 +21,7 @@ def template():
download_name="Template - Excel.xls"
),200

elif request.form.get("filetype","") == "csv":
elif request.args.get("filetype","") == "csv":
filePath = os.path.join(baseDir, 'files', 'Template - CSV.csv')
return send_file(
filePath,
Expand All @@ -30,7 +30,7 @@ def template():
download_name="Template - CSV.csv"
),200

elif request.form.get("filetype","") == "ods":
elif request.args.get("filetype","") == "ods":
filePath = os.path.join(baseDir, 'files', 'Template - ODS.ods')
return send_file(
filePath,
Expand Down

0 comments on commit a5d6df4

Please sign in to comment.