From 99ac6672baca5f1bab1dc5a3d13ab9b9fc15da1d Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Mon, 11 Nov 2024 15:20:19 -0600 Subject: [PATCH] Fix black formatting --- trovi/settings.py | 2 +- util/sql_format.py | 1 + util/test.py | 17 ++++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/trovi/settings.py b/trovi/settings.py index 5a5f581..f08050f 100644 --- a/trovi/settings.py +++ b/trovi/settings.py @@ -125,7 +125,7 @@ # Plugins "rest_framework", "drf_spectacular", - 'corsheaders', + "corsheaders", # Trovi "trovi.apps.TroviConfig", "trovi.api.apps.ApiConfig", diff --git a/util/sql_format.py b/util/sql_format.py index 3ddcaf5..b7826ae 100644 --- a/util/sql_format.py +++ b/util/sql_format.py @@ -1,4 +1,5 @@ """Pretty-Print SQL queries for console output.""" + from logging import Formatter from django.conf import settings diff --git a/util/test.py b/util/test.py index cda886c..e775f35 100644 --- a/util/test.py +++ b/util/test.py @@ -3,6 +3,7 @@ Not meant to be robust, and mostly unvalidated, but helpful to avoid having to reference dicts with strings repeatedly in tests. """ + import datetime import logging import os @@ -272,9 +273,9 @@ def generate_fake_artifact() -> list[models.Model]: ArtifactEvent( artifact_version=random.choice(artifact_versions), event_type=random.choice(ArtifactEvent.EventType.values), - event_origin=None - if fake.boolean(chance_of_getting_true=90) - else fake_user_urn(), + event_origin=( + None if fake.boolean(chance_of_getting_true=90) else fake_user_urn() + ), ) for _ in range(random.randint(0, 40)) ] @@ -284,10 +285,12 @@ def _verified() -> dict[str, Union[bool, Optional[datetime.datetime]]]: verified = fake.boolean(chance_of_getting_true=20) return { "verified": verified, - "verified_at": None - if not verified - else fake.date_time_between( - datetime.date.min, datetime.date.max, timezone.utc + "verified_at": ( + None + if not verified + else fake.date_time_between( + datetime.date.min, datetime.date.max, timezone.utc + ) ), }