From 64a4f4fc305fc72cef8a336970527acfd8bf8bbf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 07:19:51 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- funnel/templates/thumbnail_preview.html | 13 +++++-------- funnel/views/project.py | 2 +- funnel/views/thumnbnails.py | 21 +++++++++------------ 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/funnel/templates/thumbnail_preview.html b/funnel/templates/thumbnail_preview.html index f14af8858..a58adf232 100644 --- a/funnel/templates/thumbnail_preview.html +++ b/funnel/templates/thumbnail_preview.html @@ -1,8 +1,8 @@ - + - - + + @@ -11,15 +11,12 @@
{{project.account.title}}
-

- {{ project.title }} -

+

{{ project.title }}

{{ project.tagline }}
- {{ project.datelocation }} - {{ project.primary_venue }} + {{ project.datelocation }} {{ project.primary_venue }}
diff --git a/funnel/views/project.py b/funnel/views/project.py index 63db7b199..5fd5887db 100644 --- a/funnel/views/project.py +++ b/funnel/views/project.py @@ -48,7 +48,7 @@ db, sa, ) -from ..signals import project_role_change, project_data_change +from ..signals import project_data_change, project_role_change from ..typing import ReturnRenderWith, ReturnView from .helpers import html_in_json, render_redirect from .jobs import import_tickets, tag_locations diff --git a/funnel/views/thumnbnails.py b/funnel/views/thumnbnails.py index ba129cd36..111ba753d 100644 --- a/funnel/views/thumnbnails.py +++ b/funnel/views/thumnbnails.py @@ -2,26 +2,23 @@ from flask import render_template from html2image import Html2Image -from ..models import ( - Account, - Project, -) -from .jobs import rqjob -from ..signals import project_data_change +from ..models import Project +from ..signals import project_data_change +from .jobs import rqjob thumbnail = Html2Image(size=(1067, 600)) @project_data_change.connect -def generate_thumbnail_image(project = Project) -> None: - render_thumbnail_image(project = project) +def generate_thumbnail_image(project=Project) -> None: + render_thumbnail_image(project=project) + @rqjob() -def render_thumbnail_image(project = Project) -> None: +def render_thumbnail_image(project=Project) -> None: """Render the thumbnail image and cache the file using a background task""" - image_html = render_template('thumbnail_preview.html.jinja2', project = project ) + image_html = render_template('thumbnail_preview.html.jinja2', project=project) - thumbnail_image = thumbnail.screenshot(html_str=image_html, save_as='thumbnail.png', - size=(1067, 600)) + thumbnail.screenshot(html_str=image_html, save_as='thumbnail.png', size=(1067, 600))