Skip to content

Commit

Permalink
bandit not respecting the variable.so hardcoding Tue
Browse files Browse the repository at this point in the history
  • Loading branch information
saravankumarpa committed Oct 3, 2019
1 parent a711daf commit ec9c4f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions report-api/src/api/services/report_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from api.utils.util import TEMPLATE_FOLDER_PATH


ENV = Environment(loader=FileSystemLoader('.'), autoescape=JINJA_AUTO_ESCAPE)
ENV = Environment(loader=FileSystemLoader('.'), autoescape=True)


class ReportService:
Expand All @@ -46,7 +46,7 @@ def create_report_from_template(cls, template_string: str, template_args: object
generate_page_number: bool = False):
"""Create a report from a json template."""
template_decoded = base64.b64decode(template_string).decode('utf-8')
template_ = Template(template_decoded, autoescape=JINJA_AUTO_ESCAPE)
template_ = Template(template_decoded, autoescape=True)
html_out = template_.render(template_args)
return ReportService.generate_pdf(html_out, generate_page_number)

Expand Down
1 change: 0 additions & 1 deletion report-api/src/api/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@
# limitations under the License.
"""Constants."""

JINJA_AUTO_ESCAPE = True

0 comments on commit ec9c4f0

Please sign in to comment.