From a2c651812f8367463b6d070c3c01eea37a355b41 Mon Sep 17 00:00:00 2001
From: Naglis Jonaitis <naglis@versada.eu>
Date: Thu, 12 Aug 2021 12:57:11 +0300
Subject: [PATCH] [IMP] mail_notification_custom_subject: black, isort,
 prettier

---
 .../models/mail_message_custom_subject.py         |  4 +++-
 .../models/mail_thread.py                         | 15 +++++++++++----
 .../test_mail_notification_custom_subject.py      |  8 ++++++--
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/mail_notification_custom_subject/models/mail_message_custom_subject.py b/mail_notification_custom_subject/models/mail_message_custom_subject.py
index 5aaeeccc1..19a48f65d 100644
--- a/mail_notification_custom_subject/models/mail_message_custom_subject.py
+++ b/mail_notification_custom_subject/models/mail_message_custom_subject.py
@@ -16,7 +16,9 @@ class MailMessageCustomSubject(models.Model):
         help="Model where this template applies",
     )
     subtype_ids = fields.Many2many(
-        comodel_name="mail.message.subtype", string="Applied Subtypes", required=True,
+        comodel_name="mail.message.subtype",
+        string="Applied Subtypes",
+        required=True,
     )
     subject_template = fields.Char(
         string="Subject Template",
diff --git a/mail_notification_custom_subject/models/mail_thread.py b/mail_notification_custom_subject/models/mail_thread.py
index 8743fcb80..96d9abe89 100644
--- a/mail_notification_custom_subject/models/mail_thread.py
+++ b/mail_notification_custom_subject/models/mail_thread.py
@@ -29,16 +29,23 @@ class MailThread(models.AbstractModel):
             if "." not in subtype:
                 subtype = "mail.%s" % subtype
             subtype_id = self.env["ir.model.data"].xmlid_to_res_id(
-                subtype, raise_if_not_found=False,
+                subtype,
+                raise_if_not_found=False,
             )
         if subtype_id:
             custom_subjects = self.env["mail.message.custom.subject"].search(
                 [("model_id.model", "=", self._name), ("subtype_ids", "=", subtype_id)]
             )
             if not subject:
-                subject = "Re: %s" % self.env["mail.message"].with_context(
-                    default_model=self._name, default_res_id=self.id,
-                )._get_record_name({})
+                subject = (
+                    "Re: %s"
+                    % self.env["mail.message"]
+                    .with_context(
+                        default_model=self._name,
+                        default_res_id=self.id,
+                    )
+                    ._get_record_name({})
+                )
             for template in custom_subjects:
                 try:
                     rendered_subject_template = self.env[
diff --git a/mail_notification_custom_subject/tests/test_mail_notification_custom_subject.py b/mail_notification_custom_subject/tests/test_mail_notification_custom_subject.py
index 26222b0fa..68cbc7f72 100644
--- a/mail_notification_custom_subject/tests/test_mail_notification_custom_subject.py
+++ b/mail_notification_custom_subject/tests/test_mail_notification_custom_subject.py
@@ -134,7 +134,9 @@ class TestMailNotificationCustomSubject(common.TransactionCase):
         )
         # Send message in partner
         mail_message_1 = self.partner_1.message_post(
-            body="Test", subtype="mail.mt_comment", subject="Test",
+            body="Test",
+            subtype="mail.mt_comment",
+            subject="Test",
         )
         # Get message and check subject
         self.assertEquals(mail_message_1.subject, "Test and something more")
@@ -152,7 +154,9 @@ class TestMailNotificationCustomSubject(common.TransactionCase):
         )
         # Send message in partner
         mail_message_1 = self.partner_1.message_post(
-            body="Test", subtype="mail.mt_comment", subject="Test",
+            body="Test",
+            subtype="mail.mt_comment",
+            subject="Test",
         )
         # Get message and check subject
         # No exception should be raised but subject should remain as original.