[PR #428] [MERGED] fix: handle null category in TransactionCategoryField serialization #422

Closed
opened 2025-12-29 00:20:19 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/eitchtee/WYGIWYH/pull/428
Author: @SerafimPikalov
Created: 12/7/2025
Status: Merged
Merged: 12/7/2025
Merged by: @eitchtee

Base: mainHead: fix/null-category-serialization


📝 Commits (1)

  • fb1b383 fix: handle null category in TransactionCategoryField serialization

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 app/apps/api/fields/transactions.py (+6 -2)

📄 Description

Fix AttributeError when serializing transactions with null categories. The to_representation method now checks for None before accessing category properties, returning None instead of crashing.

Fixes issue where API returns 500 error when retrieving transactions without assigned categories.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/eitchtee/WYGIWYH/pull/428 **Author:** [@SerafimPikalov](https://github.com/SerafimPikalov) **Created:** 12/7/2025 **Status:** ✅ Merged **Merged:** 12/7/2025 **Merged by:** [@eitchtee](https://github.com/eitchtee) **Base:** `main` ← **Head:** `fix/null-category-serialization` --- ### 📝 Commits (1) - [`fb1b383`](https://github.com/eitchtee/WYGIWYH/commit/fb1b383962cbd0c61d66bcf681f717156591a238) fix: handle null category in TransactionCategoryField serialization ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `app/apps/api/fields/transactions.py` (+6 -2) </details> ### 📄 Description Fix AttributeError when serializing transactions with null categories. The to_representation method now checks for None before accessing category properties, returning None instead of crashing. Fixes issue where API returns 500 error when retrieving transactions without assigned categories. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 00:20:19 +01:00
adam closed this issue 2025-12-29 00:20:19 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WYGIWYH#422