fix ruff errors

This commit is contained in:
FuzzyGrim
2026-02-06 00:05:05 +01:00
parent 57bc3b9de5
commit a961d006fb
6 changed files with 6 additions and 6 deletions

View File

@@ -116,7 +116,7 @@ def collect_creation_changes(new_record, history_model, media_type, user):
for field in history_model._meta.get_fields():
if (
field.name.startswith("history_")
or field.name in ["id"]
or field.name == "id"
or not hasattr(new_record, field.attname)
or (field.name == "progress" and media_type == MediaTypes.MOVIE.value)
):

View File

@@ -272,7 +272,7 @@ def get_categories(item):
for link in item.findall(".//link[@type='boardgamecategory']")
if link.get("value")
]
return categories if categories else None
return categories or None
def get_designers(item):

View File

@@ -213,7 +213,7 @@ def get_edition_details(edition_data):
return {
"format": edition_data.get("edition_format") or "Unknown",
"publisher": publisher_name,
"isbn": isbns if isbns else None,
"isbn": isbns or None,
"release_date": edition_data.get("release_date"),
}

View File

@@ -161,7 +161,7 @@ def get_image_url(response):
"""Get the image URL for a media item."""
# when no image, value from response is null
url = response["image"]["url"]["original"]
return url if url else settings.IMG_NONE
return url or settings.IMG_NONE
def get_max_progress(response):

View File

@@ -276,7 +276,7 @@ async def get_authors(response):
data.get("name", "Unknown Author") for data in author_data_list if data
]
return authors if authors else None
return authors or None
async def fetch_author_data(session, url):

View File

@@ -22,7 +22,7 @@ class CustomListAdmin(admin.ModelAdmin):
def get_last_update(self, obj):
"""Return the date of the last item added."""
last_update = CustomListItem.objects.get_last_added_date(obj)
return last_update if last_update else "-"
return last_update or "-"
get_last_update.short_description = "Last updated"