fix(lint): use dict() not a dict-comprehension in tag_stats (C416)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
This commit is contained in:
@@ -127,15 +127,15 @@ async def tag_stats(tag_id: int):
|
|||||||
tag = await session.get(Tag, tag_id)
|
tag = await session.get(Tag, tag_id)
|
||||||
if tag is None:
|
if tag is None:
|
||||||
return jsonify({"error": "not found"}), 404
|
return jsonify({"error": "not found"}), 404
|
||||||
by_source = {
|
by_source = dict(
|
||||||
src: n for src, n in (
|
(
|
||||||
await session.execute(
|
await session.execute(
|
||||||
select(image_tag.c.source, func.count())
|
select(image_tag.c.source, func.count())
|
||||||
.where(image_tag.c.tag_id == tag_id)
|
.where(image_tag.c.tag_id == tag_id)
|
||||||
.group_by(image_tag.c.source)
|
.group_by(image_tag.c.source)
|
||||||
)
|
)
|
||||||
).all()
|
).all()
|
||||||
}
|
)
|
||||||
rejected = (
|
rejected = (
|
||||||
await session.execute(
|
await session.execute(
|
||||||
select(func.count())
|
select(func.count())
|
||||||
|
|||||||
Reference in New Issue
Block a user