feat: #337 viewsをClass Based Viewに変換#892
Conversation
- 全viewをdjango.views.Viewベースに変換(ad.py, errors.py, file.pyを除く) - ad_complete.pyはTemplateViewを使用 - song_edit, song_delete: dispatch()でsong取得・404/lock判定を共通化 - contact: dispatch()でcontact_qsを共通化 - song_new, song_edit, song_delete: get_base_context()でcontext初期化を共通化 - songs: get/postを_handle()に統合 - dataD/detaDをcontextに統一 - urls.py, __init__.pyを新クラス名に合わせて更新 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- articles.py → ArticlesView(View) - anniversary6.py → Anniversary6View(TemplateView) - default_article.py → DefaultArticleView(View) - dataD → context に統一 - __init__.py, urls.py を新クラス名に更新 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code ReviewThis is a clean, well-structured refactoring PR. The FBV-to-CBV conversion is consistent, the Code Quality & Best PracticesPositives:
Nitpick — Nitpick — UPPER_CASE local variables in Potential Bugs[Carried over] [Carried over] Performance Considerations
Security Concerns[Carried over] Potential XSS in [Carried over] Reflected XSS risk in [Carried over] No regressions introduced: CSRF handling, the Test CoverageNo automated tests accompany this large refactor (675 additions, 620 deletions across ~20 files). The behavior-preserving nature of the conversion reduces risk, but automated regression tests would significantly increase confidence. At minimum, please confirm the existing test suite passes before merging. The manual test plan in the PR description is a good start. SummaryThe conversion is well-executed and idiomatic. The pre-existing bugs and security concerns noted above are out of scope for this PR, but this would be a good time to address them since the code is already being touched. The main actionable item before merging is verifying the XSS concerns in the templates and running the test suite. |
概要
subekashi/views/およびarticle/views/の全ビューをClass Based View(CBV)に変換dataD/detaDをcontextに統一変換方針
TemplateViewad_complete.py,anniversary6.pydispatch()+get_base_context()song_edit.py,song_delete.py,contact.pyget_base_context()song_new.py_handle()songs.pyView(getのみ)変換しないファイル
ad.py— 対象外errors.py— Django error handlerはFBV必須file.py— 単純なリダイレクト、CBV化の恩恵なしTest plan
🤖 Generated with Claude Code