diff --git a/contracts/admin.py b/contracts/admin.py
index 7b9190e7a14241fb62b7aa487e2c6018667abd13..5bd4f21f88af050f98f2bba54a91290461abfe00 100644
--- a/contracts/admin.py
+++ b/contracts/admin.py
@@ -35,9 +35,9 @@ from .models import (
     ContractIssue,
     ContractType,
     Signee,
+    SigneeHistoricalName,
     SigneeSignature,
     SigneeSignatureRepresentative,
-    SigneeHistoricalName,
 )
 
 logger = logging.getLogger()
@@ -712,22 +712,16 @@ class SigneeHistoricalNameInline(NestedTabularInline):
     extra = 0
 
     def get_parent_object_is_editable(self, obj, request):
-        if (
-            not request.user.has_perm("signee.edit")
-            and not (
-                obj.created_by == request.user
-                and request.user.has_perm("signee.edit_others")
-            )
+        if not request.user.has_perm("signee.edit") and not (
+            obj.created_by == request.user
+            and request.user.has_perm("signee.edit_others")
         ):
             return False
 
         return super().has_change_permission(request, obj)
 
     def has_add_permission(self, request, obj=None):
-        if (
-            obj is not None
-            and not self.get_parent_object_is_editable(obj, request)
-        ):
+        if obj is not None and not self.get_parent_object_is_editable(obj, request):
             return False
 
         return super().has_add_permission(request, obj)
@@ -737,7 +731,7 @@ class SigneeHistoricalNameInline(NestedTabularInline):
 
     def has_delete_permission(self, request, obj=None):
         return self.has_add_permission(request, obj)
-    
+
 
 class SigneeAdmin(OwnPermissionsMixin, MarkdownxGuardedModelAdmin):
     model = Signee
diff --git a/contracts/management/commands/import_old_contracts.py b/contracts/management/commands/import_old_contracts.py
index 06352c91cb3902e4064fcc65532d21118a139c69..e39380321bdfec8470adae91b27975d11b4d8303 100644
--- a/contracts/management/commands/import_old_contracts.py
+++ b/contracts/management/commands/import_old_contracts.py
@@ -10,9 +10,10 @@ from django.conf import settings
 from django.core.files import File
 from django.core.management.base import BaseCommand
 from django.db import models
-from git import Repo
 from postal.parser import parse_address
 
+from git import Repo
+
 from ...models import (
     Contract,
     Contractee,
@@ -410,19 +411,31 @@ class Command(BaseCommand):
 
         patterns = (
             (r"\s\s+", " "),
-            (r"^(B|b)(C|c)(\.| )|MDDr\.|MDDR\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.", ""),
+            (
+                r"^(B|b)(C|c)(\.| )|MDDr\.|MDDR\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.",
+                "",
+            ),
             (r"\s(e|E)t\s", ""),
             (r"\s\s+", " "),
             (r"^ ", ""),
-            (r"^(B|b)c\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.", ""),
+            (
+                r"^(B|b)c\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.",
+                "",
+            ),
             (r"\s(e|E)t\s", ""),
             (r"\s\s+", " "),
             (r"^ ", ""),
-            (r"^(B|b)c\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.", ""),
+            (
+                r"^(B|b)c\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.",
+                "",
+            ),
             (r"\s(e|E)t\s", ""),
             (r"\s\s+", " "),
             (r"^ ", ""),
-            (r"^(B|b)c\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.", ""),
+            (
+                r"^(B|b)c\.|^(A|a)rch\.|,\s(M|m)(B|b)(A|a)$|,\s(M|m)sc\.$|^(M|m)(U|u)(D|d)r\.|,\s(P|p)h\.(D|d)(\.|)$|^(M|m)g(r|A|a)\.|^(I|i)ng\.|^PeadDr\.|^PeaDr\.|^(P|p)h(D|d)r\.",
+                "",
+            ),
             (r"\s(e|E)t\s", ""),
             (r"\s\s+", " "),
             (r"^ ", ""),
@@ -455,7 +468,7 @@ class Command(BaseCommand):
             (r"^Jan Bohm$", "Jan Böhm"),
             (
                 r"^Kooperativa$|^Kooperativa pojišťovna a\.s\.$|^Kooperativa pojišťovna, a\.s\.$",
-                "Kooperativa pojišťovna, a.s., Vienna Insurance Group"
+                "Kooperativa pojišťovna, a.s., Vienna Insurance Group",
             ),
             (r"^Dominika P\. Michailidu$", "Dominika Poživilová Michailidu"),
             (r"^Miluš ", "Miluše"),
@@ -495,8 +508,6 @@ class Command(BaseCommand):
             (r"^Jan žák$", "Jan Žák"),
             (r"^MilušeKotišová$", "Miluše Kotišová"),
             (r"RAINREKNAM", "RAILREKLAM"),
-
-            
             # Weird N-instead-of-L names
             (r"^Nadislav", "Ladislav"),
             (r"^Nukáš", "Lukáš"),
@@ -846,23 +857,31 @@ class Command(BaseCommand):
 
                         continue
 
-                    if signing_party_value in (
-                        "Česká Pirátská strana",
-                        "Česká pirátská strana",
-                        "Čeksá pirátská strana",
-                        "piráti",
-                        "Piráti"
-                    ) or signing_party_value == instance.name:
+                    if (
+                        signing_party_value
+                        in (
+                            "Česká Pirátská strana",
+                            "Česká pirátská strana",
+                            "Čeksá pirátská strana",
+                            "piráti",
+                            "Piráti",
+                        )
+                        or signing_party_value == instance.name
+                    ):
                         # Irrelevant
                         self.normalization_count += 1
                         continue
 
-                    if signing_party_value and model is Signee and instance.entity_type == instance.EntityTypes.NATURAL_PERSON:
+                    if (
+                        signing_party_value
+                        and model is Signee
+                        and instance.entity_type == instance.EntityTypes.NATURAL_PERSON
+                    ):
                         issue_count += 1
-                        contract.notes += f"Fyzická osoba má zadaný orgán: {signing_party_value}\n"
-                        issues.append(
-                            self.use_issue("Chybná organizační složka")
+                        contract.notes += (
+                            f"Fyzická osoba má zadaný orgán: {signing_party_value}\n"
                         )
+                        issues.append(self.use_issue("Chybná organizační složka"))
 
                         if self.verbosity >= 2:
                             self.stderr.write(
@@ -874,14 +893,12 @@ class Command(BaseCommand):
 
                         continue
 
-                    if signing_party_value in (
-                        "dle stanov a na základě plné moci",
-                    ):
+                    if signing_party_value in ("dle stanov a na základě plné moci",):
                         issue_count += 1
-                        contract.notes += f"Chybná organizační složka: {signing_party_value}\n"
-                        issues.append(
-                            self.use_issue("Chybná organizační složka")
+                        contract.notes += (
+                            f"Chybná organizační složka: {signing_party_value}\n"
                         )
+                        issues.append(self.use_issue("Chybná organizační složka"))
 
                         if self.verbosity >= 2:
                             self.stderr.write(
diff --git a/contracts/management/commands/load_from_ico.py b/contracts/management/commands/load_from_ico.py
index 378039ab03e0a1567129274f525d41f760a653eb..e96c6080dc35348168bf556f9c50bd8cd7fe4b55 100644
--- a/contracts/management/commands/load_from_ico.py
+++ b/contracts/management/commands/load_from_ico.py
@@ -1,6 +1,7 @@
+import requests
 from django.core.management.base import BaseCommand
+
 from contracts.models import Signee, SigneeHistoricalName
-import requests
 
 
 class Command(BaseCommand):
@@ -20,15 +21,15 @@ class Command(BaseCommand):
                 formatted_ares_data = ares_info.json()
 
                 street = ""
-                
+
                 if "nazevUlice" in formatted_ares_data["sidlo"]:
                     street += formatted_ares_data["sidlo"]["nazevUlice"]
 
                 if "cisloDomovni" in formatted_ares_data["sidlo"]:
-                    street += (" " + str(formatted_ares_data["sidlo"]["cisloDomovni"]))
+                    street += " " + str(formatted_ares_data["sidlo"]["cisloDomovni"])
 
                 if "cisloOrientacni" in formatted_ares_data["sidlo"]:
-                    street += ("/" + str(formatted_ares_data["sidlo"]["cisloOrientacni"]))
+                    street += "/" + str(formatted_ares_data["sidlo"]["cisloOrientacni"])
 
                 changed = False
 
@@ -37,13 +38,15 @@ class Command(BaseCommand):
                     "address_street_with_number": street,
                     "address_district": formatted_ares_data["sidlo"]["nazevCastiObce"],
                     "address_zip": formatted_ares_data["sidlo"]["psc"],
-                    "address_country": formatted_ares_data["sidlo"]["nazevStatu"]
+                    "address_country": formatted_ares_data["sidlo"]["nazevStatu"],
                 }
 
                 for attribute, value in attribute_sets.items():
                     if str(getattr(signee, attribute)) != str(value):
                         changed = True
-                        self.stdout.write(f"\nUpdating {signee}'s {attribute}:\n\tOLD:\t{getattr(signee, attribute)}\n\tNEW:\t{value}\n")
+                        self.stdout.write(
+                            f"\nUpdating {signee}'s {attribute}:\n\tOLD:\t{getattr(signee, attribute)}\n\tNEW:\t{value}\n"
+                        )
 
                 if changed:
                     if not do_all:
@@ -76,8 +79,7 @@ class Command(BaseCommand):
                         if attribute in attrs_to_change:
                             if attribute == "name":
                                 historical_name = SigneeHistoricalName(
-                                    signee=signee,
-                                    name=signee.name
+                                    signee=signee, name=signee.name
                                 )
                                 historical_name.save()
 
@@ -87,8 +89,12 @@ class Command(BaseCommand):
 
                     signee.save()
 
-                    self.stdout.write(self.style.SUCCESS(f"\nChanged ({','.join(changed_attrs)})."))
+                    self.stdout.write(
+                        self.style.SUCCESS(f"\nChanged ({','.join(changed_attrs)}).")
+                    )
                     self.stdout.write("\n\n\n")
 
             except Exception:
-                self.stdout.write(self.style.WARNING(f"Signee {signee}'s IÄŚO appears to be invalid."))
\ No newline at end of file
+                self.stdout.write(
+                    self.style.WARNING(f"Signee {signee}'s IÄŚO appears to be invalid.")
+                )
diff --git a/contracts/migrations/0071_signeehistoricalname.py b/contracts/migrations/0071_signeehistoricalname.py
index 43fe1ebc53a358bc105e2cb159bae3126237f6c9..8dc11c6f9d3ea7c3a5ac27a35c597a119bb30617 100644
--- a/contracts/migrations/0071_signeehistoricalname.py
+++ b/contracts/migrations/0071_signeehistoricalname.py
@@ -1,26 +1,41 @@
 # Generated by Django 4.1.4 on 2024-09-11 11:47
 
-from django.db import migrations, models
 import django.db.models.deletion
+from django.db import migrations, models
 
 
 class Migration(migrations.Migration):
-
     dependencies = [
-        ('contracts', '0070_alter_contract_paper_form_state'),
+        ("contracts", "0070_alter_contract_paper_form_state"),
     ]
 
     operations = [
         migrations.CreateModel(
-            name='SigneeHistoricalName',
+            name="SigneeHistoricalName",
             fields=[
-                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('name', models.CharField(max_length=256, verbose_name='Jméno')),
-                ('signee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='historical_names', to='contracts.signee', verbose_name='SmluvnĂ­ strana')),
+                (
+                    "id",
+                    models.BigAutoField(
+                        auto_created=True,
+                        primary_key=True,
+                        serialize=False,
+                        verbose_name="ID",
+                    ),
+                ),
+                ("name", models.CharField(max_length=256, verbose_name="Jméno")),
+                (
+                    "signee",
+                    models.ForeignKey(
+                        on_delete=django.db.models.deletion.CASCADE,
+                        related_name="historical_names",
+                        to="contracts.signee",
+                        verbose_name="SmluvnĂ­ strana",
+                    ),
+                ),
             ],
             options={
-                'verbose_name': 'Historické jméno smluvní strany',
-                'verbose_name_plural': 'Historická jména smluvních stran',
+                "verbose_name": "Historické jméno smluvní strany",
+                "verbose_name_plural": "Historická jména smluvních stran",
             },
         ),
     ]
diff --git a/contracts/settings.py b/contracts/settings.py
index 208b42834adedea62ec03743c47715264afd0d79..7058548a4eb886755208b3c38214d4dd5f16b758 100644
--- a/contracts/settings.py
+++ b/contracts/settings.py
@@ -16,4 +16,4 @@ class ContractSettings(dbsettings.Group):
     closed_message = dbsettings.StringValue(
         "Text při uzavřeném registru",
         widget=forms.Textarea,
-    )
\ No newline at end of file
+    )
diff --git a/contracts/urls.py b/contracts/urls.py
index 22a877020505a70f0c06b37c4609df2edbca3a3d..343984bdcc4c903fb5722d1f44b21c71ee2e8d2e 100644
--- a/contracts/urls.py
+++ b/contracts/urls.py
@@ -11,7 +11,9 @@ urlpatterns = [
         name="search",
     ),
     path("contracts/<int:id>", views.view_contract, name="view_contract"),
-    path("contracts/<int:id>.json", views.view_contract_json, name="view_contract_json"),
+    path(
+        "contracts/<int:id>.json", views.view_contract_json, name="view_contract_json"
+    ),
     path(
         "contracts/filing-areas/<int:id>",
         views.view_contract_filing_area,
diff --git a/contracts/views.py b/contracts/views.py
index bf550e31feac4a83551a2099a97a107ccf088153..6e0d4f8fcbcdb59049cb2be01aeb2317507068eb 100644
--- a/contracts/views.py
+++ b/contracts/views.py
@@ -454,42 +454,35 @@ def view_contract_json(request, id: int):
         id=id,
     )
 
-    return JsonResponse({
-        "id": contract.id,
-        "created_by": {
-            "id": contract.created_by_id,
-            "username": contract.created_by.username,
-        },
-        "created_on": contract.created_on,
-        "updated_on": contract.updated_on,
-        "status": contract.status,
-        "name": contract.name,
-        "id_number": contract.id_number,
-        "types": [
-            {
-                "id": type.id,
-                "name": type.name
-            }
-            for type in contract.types.all()
-        ],
-        "summary": contract.summary,
-        "valid_start_date": contract.valid_start_date,
-        "valid_end_date": contract.valid_end_date,
-        "is_valid": contract.is_valid,
-        "is_public": contract.is_public,
-        "publishing_rejection_comment": contract.publishing_rejection_comment,
-        "paper_form_state": contract.paper_form_state,
-        "paper_form_person_responsible": contract.paper_form_person_responsible,
-        "tender_url": contract.tender_url,
-        "issues": [
-            {
-                "id": issue.id,
-                "name": issue.name
-            }
-            for issue in contract.issues.all()
-        ]
-
-    })
+    return JsonResponse(
+        {
+            "id": contract.id,
+            "created_by": {
+                "id": contract.created_by_id,
+                "username": contract.created_by.username,
+            },
+            "created_on": contract.created_on,
+            "updated_on": contract.updated_on,
+            "status": contract.status,
+            "name": contract.name,
+            "id_number": contract.id_number,
+            "types": [
+                {"id": type.id, "name": type.name} for type in contract.types.all()
+            ],
+            "summary": contract.summary,
+            "valid_start_date": contract.valid_start_date,
+            "valid_end_date": contract.valid_end_date,
+            "is_valid": contract.is_valid,
+            "is_public": contract.is_public,
+            "publishing_rejection_comment": contract.publishing_rejection_comment,
+            "paper_form_state": contract.paper_form_state,
+            "paper_form_person_responsible": contract.paper_form_person_responsible,
+            "tender_url": contract.tender_url,
+            "issues": [
+                {"id": issue.id, "name": issue.name} for issue in contract.issues.all()
+            ],
+        }
+    )
 
 
 # ARES CORS proxy
diff --git a/registry/middleware.py b/registry/middleware.py
index 1d89bacd0fc78d37f8e3045efcdc021ff5e1ef49..606424f850a3043ebbd457a56effdbdf4066e8f8 100644
--- a/registry/middleware.py
+++ b/registry/middleware.py
@@ -1,7 +1,8 @@
-from contracts.models import Contract;
 from django.http import HttpResponse
-from django.urls import resolve
 from django.shortcuts import render
+from django.urls import resolve
+
+from contracts.models import Contract
 
 
 class InterruptMiddleware:
@@ -10,7 +11,7 @@ class InterruptMiddleware:
 
     def __call__(self, request):
         resolver_match = resolve(request.path_info)
-        
+
         # You can now access the view name and other details
         view_name = resolver_match.view_name
 
@@ -21,10 +22,12 @@ class InterruptMiddleware:
             and view_name not in ("admin:login",)
         ):
             # Interrupt the request by returning a response
-            return render(request, "closed.html", {
-                "closed_message": Contract.settings.closed_message
-            })
-        
+            return render(
+                request,
+                "closed.html",
+                {"closed_message": Contract.settings.closed_message},
+            )
+
         # If not interrupted, continue with the request
         response = self.get_response(request)
-        return response
\ No newline at end of file
+        return response
diff --git a/requirements/base.in b/requirements/base.in
index 5817ceea2a37a7e8054575276a49efd50c55afba..2184ff21a03e54bb2bd8187627a0d97dbe94c6a8 100644
--- a/requirements/base.in
+++ b/requirements/base.in
@@ -23,4 +23,4 @@ Markdown
 postal
 PyJWT
 PyYAML
-requests
\ No newline at end of file
+requests