run precommit
This commit is contained in:
parent
3bc11edaf9
commit
cfa738f128
|
@ -1,7 +1,10 @@
|
||||||
"""Email_service."""
|
"""Email_service."""
|
||||||
|
from typing import List
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask_mail import Message # type: ignore
|
from flask_mail import Message # type: ignore
|
||||||
from typing import List, Optional
|
|
||||||
|
|
||||||
class EmailService:
|
class EmailService:
|
||||||
"""Provides common interface for working with an Email."""
|
"""Provides common interface for working with an Email."""
|
||||||
|
@ -13,11 +16,11 @@ class EmailService:
|
||||||
recipients: List[str],
|
recipients: List[str],
|
||||||
content: str,
|
content: str,
|
||||||
content_html: str,
|
content_html: str,
|
||||||
cc: Optional[str]=None,
|
cc: Optional[str] = None,
|
||||||
bcc: Optional[str]=None,
|
bcc: Optional[str] = None,
|
||||||
reply_to: Optional[str]=None,
|
reply_to: Optional[str] = None,
|
||||||
attachment_files: Optional[dict]=None,
|
attachment_files: Optional[dict] = None,
|
||||||
) ->None:
|
) -> None:
|
||||||
"""We will receive all data related to an email and send it."""
|
"""We will receive all data related to an email and send it."""
|
||||||
mail = current_app.config["MAIL_APP"]
|
mail = current_app.config["MAIL_APP"]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
"""Error_handling_service."""
|
"""Error_handling_service."""
|
||||||
from typing import Any, List, Union
|
from typing import Any
|
||||||
|
from typing import List
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
from flask_bpmn.api.api_error import ApiError
|
from flask_bpmn.api.api_error import ApiError
|
||||||
from flask_bpmn.models.db import db
|
from flask_bpmn.models.db import db
|
||||||
|
@ -64,7 +66,11 @@ class ErrorHandlingService:
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def handle_email_notification(processor: ProcessInstanceProcessor, error: Union[ApiError, Exception], recipients: List) ->None:
|
def handle_email_notification(
|
||||||
|
processor: ProcessInstanceProcessor,
|
||||||
|
error: Union[ApiError, Exception],
|
||||||
|
recipients: List,
|
||||||
|
) -> None:
|
||||||
"""EmailHandler."""
|
"""EmailHandler."""
|
||||||
subject = "Unexpected error in app"
|
subject = "Unexpected error in app"
|
||||||
if isinstance(error, ApiError):
|
if isinstance(error, ApiError):
|
||||||
|
|
|
@ -821,7 +821,9 @@ def test_process_instance_report_with_default_list(
|
||||||
assert process_instance_dict["status"] == "not_started"
|
assert process_instance_dict["status"] == "not_started"
|
||||||
|
|
||||||
|
|
||||||
def setup_testing_instance(client: FlaskClient, process_group_id: str, process_model_id: str, user: UserModel) -> Any:
|
def setup_testing_instance(
|
||||||
|
client: FlaskClient, process_group_id: str, process_model_id: str, user: UserModel
|
||||||
|
) -> Any:
|
||||||
"""Setup_testing_instance."""
|
"""Setup_testing_instance."""
|
||||||
headers = logged_in_headers(user)
|
headers = logged_in_headers(user)
|
||||||
response = create_process_instance(
|
response = create_process_instance(
|
||||||
|
|
Loading…
Reference in New Issue