BUG: Album create/update accept a blank or whitespace-only name
メンテナーはふだん 10 日以内に返信
@sayxnn17 がすでに取り組んでいます。
2026年11月17日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 80/100
調査の方向性
backend/app/schemas/album.pyを読み、特に既存のCreateAlbumFromMemoryRequestバリデーターと作成・更新リクエストのスキーマを確認してください。既存のテスト規約に従い、両方のアルバムエンドポイントで空の名前と空白文字のみの名前を対象とするテストを追加してください。両方のリクエストがそのような名前を拒否し、有効な名前は引き続き使えることを完了条件とします。
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Bug Description
The album create and update endpoints accept a blank or whitespace-only name, so an album can be saved with an empty name ("" or " "). The name column has no such guard either, so the blank name is persisted.
Cause
In backend/app/schemas/album.py:
CreateAlbumRequest.nameisField(..., min_length=1)(line 25).min_lengthcounts whitespace, so" "(length 3) passes and reaches the database as a blank name.UpdateAlbumRequest.nameis a plainstr(line 52) with nomin_lengthand no validator at all, so even""passes.
The project already solved exactly this in the same file: CreateAlbumFromMemoryRequest has a check_not_blank validator (lines 42–48) that strips the value and rejects it if empty, with a comment noting "min_length counts the spaces, so ' ' would otherwise get through." That guard was simply never added to CreateAlbumRequest or UpdateAlbumRequest.
Downstream nothing catches it: the albums.album_name column is TEXT UNIQUE (no NOT NULL, no check), and db_insert_album / db_update_album write the value as-is without stripping.
Steps to reproduce
- Create:
→POST /albums/ {"name": " "}200; an album is created whose name is only spaces. - Update:
→PUT /albums/{id} {"name": "", "is_locked": false}200; the album's name is now empty.
Expected behavior
Both requests should be rejected with a 422/400 when name is blank or whitespace-only, consistent with CreateAlbumFromMemoryRequest.
Suggested fix
- Add a
check_not_blankfield validator (strip, then reject if empty) toCreateAlbumRequest.nameandUpdateAlbumRequest.name, mirroring the existing one onCreateAlbumFromMemoryRequest, and store the stripped name. - Add tests for the create and update paths.
Notes
Not a duplicate of #1254 (empty/whitespace image_ids, which is already fixed) or #1612 (renaming to an existing name). This is specifically about blank/whitespace album names on create and update.
I'd like to work on this if it's approved.
Record
- I agree to follow this project's Code of Conduct
- 主要言語
- Python
- スター
- 320
- フォーク
- 771
- 平均マージ
- 9日 5時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
BUG: Add images to album: success message shows requested count, not number actually added対応中かも @avika269 が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/PictoPy#1740 · コメント 2 件 ·
メンテナーはふだん 10 日以内に返信
-
BUG: /sync-folder does not validate the supplied folder_id対応中かも @sathvikn113 が 4 日前に担当しました。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/PictoPy#1731 · コメント 5 件 ·
メンテナーはふだん 10 日以内に返信
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md references対応中かも @avika269 が 4 日前に担当しました。 オープンdocumentation
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
AOSSIE-Org/PictoPy#1730 · コメント 5 件 ·
メンテナーはふだん 10 日以内に返信
-
bug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/PictoPy#1729 · コメント 4 件 ·
メンテナーはふだん 10 日以内に返信
-
BUG: Memory curator misses upcoming anniversaries across year boundaries and on leap days対応中かも @akhilmodi29 が 5 日前に担当しました。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
AOSSIE-Org/PictoPy#1725 · コメント 4 件 ·
メンテナーはふだん 10 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Niko1221/Strata#6475 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
-
skills: _skill_body cuts the frontmatter short when a description contains ---対応中かも @nurlanmnn が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zilliztech/memsearch#876 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
acl-org/acl-anthology#11025 ·
メンテナーはふだん 1 日以内に返信