Skip to content

Commit

Permalink
style: format code with Autopep8, Black, ClangFormat, dotnet-format, …
Browse files Browse the repository at this point in the history
…Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf

This commit fixes the style issues introduced in 5f817e3 according to the output
from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java
Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt,
Scalafmt, StandardJS, StandardRB, swift-format and Yapf.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored May 11, 2024
1 parent 5f817e3 commit e8b0ad0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/utils/helpers.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Helper utilities
import os


def send_file(file, as_attachment=True):
if as_attachment:
return send_file_from_directory(file, as_attachment=True)
return send_file_from_memory(file)


def send_file_from_directory(file, as_attachment=True):
file_path = os.path.join(current_app.config['UPLOAD_FOLDER'], file)
return send_from_directory(current_app.config['UPLOAD_FOLDER'], file, as_attachment=as_attachment)
file_path = os.path.join(current_app.config["UPLOAD_FOLDER"], file)
return send_from_directory(
current_app.config["UPLOAD_FOLDER"], file, as_attachment=as_attachment
)


def send_file_from_memory(file):
return send_file(file, mimetype='application/octet-stream', as_attachment=True)
return send_file(file, mimetype="application/octet-stream", as_attachment=True)

0 comments on commit e8b0ad0

Please sign in to comment.