Originally created by @SerafimPikalov on GitHub (Dec 7, 2025).
When a transaction has no category assigned (category=None), the API serializer crashes with an AttributeError when trying to serialize the transaction.
Steps to Reproduce:
Create a transaction via API without a category field, or set category to null
Attempt to retrieve the transaction via GET request to /api/transactions/{id}/
API returns 500 error
Expected Behavior:
Transactions without categories should serialize successfully, returning category: null in the JSON response.
Actual Behavior:
API crashes with AttributeError: 'NoneType' object has no attribute 'id' when trying to access value.id on a None category.
Originally created by @SerafimPikalov on GitHub (Dec 7, 2025).
When a transaction has no category assigned (`category=None`), the API serializer crashes with an `AttributeError` when trying to serialize the transaction.
Steps to Reproduce:
1. Create a transaction via API without a category field, or set category to `null`
2. Attempt to retrieve the transaction via GET request to `/api/transactions/{id}/`
3. API returns 500 error
Expected Behavior:
Transactions without categories should serialize successfully, returning `category: null` in the JSON response.
Actual Behavior:
API crashes with `AttributeError: 'NoneType' object has no attribute 'id'` when trying to access `value.id` on a None category.
@SerafimPikalov commented on GitHub (Dec 7, 2025):
Pull request to fix it: https://github.com/eitchtee/WYGIWYH/pull/428
Solution could be questionable because change validation shems, but works for me
Thank you for the report and the fix, but I can't seem to reproduce this locally or on a production environment.
Setting category to null raises a 400 error, which makes sense considering the schema, but could probably be changed since categories are indeed nullable.
And GETting a transaction with a null category just works.
Do you have some reproducible curls commands (or something else)?
@eitchtee commented on GitHub (Dec 7, 2025):
Thank you for the report and the fix, but I can't seem to reproduce this locally or on a production environment.
Setting category to null raises a 400 error, which makes sense considering the schema, but could probably be changed since categories are indeed nullable.
And GETting a transaction with a null category just works.
Do you have some reproducible curls commands (or something else)?
@SerafimPikalov commented on GitHub (Dec 7, 2025):
I’m out of code right now and can’t test it, but it should be pretty close to these ones:
1. First, create a transaction without a category:
curl -X POST http://127.0.0.1:9005/api/transactions/ \
-u "login:pass" \
-H "Content-Type: application/json" \
-d '{
"account_id": 1,
"date": "2025-02-03",
"amount": "123.45",
"description": "Example purchase",
"type": "EX",
"is_paid": true
}'
2. Set prexisted category:
curl -X PATCH http://127.0.0.1:9005/api/transactions/1234/ \
-u "login:pass" \
-H "Content-Type: application/json" \
-d '{"category": "Groceries"}'
However the fix is solid and shouldn't cause any problems.
@eitchtee commented on GitHub (Dec 7, 2025):
Yeah, no luck on my side.
<img width="1686" height="864" alt="Image" src="https://github.com/user-attachments/assets/3968d14d-eb9b-4c3f-a930-e45a19bd99d0" />
<img width="1679" height="862" alt="Image" src="https://github.com/user-attachments/assets/a66fc2fc-0616-48a5-a9f1-0391d9199b2a" />
However the fix is solid and shouldn't cause any problems.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @SerafimPikalov on GitHub (Dec 7, 2025).
When a transaction has no category assigned (
category=None), the API serializer crashes with anAttributeErrorwhen trying to serialize the transaction.Steps to Reproduce:
null/api/transactions/{id}/Expected Behavior:
Transactions without categories should serialize successfully, returning
category: nullin the JSON response.Actual Behavior:
API crashes with
AttributeError: 'NoneType' object has no attribute 'id'when trying to accessvalue.idon a None category.@SerafimPikalov commented on GitHub (Dec 7, 2025):
Pull request to fix it: https://github.com/eitchtee/WYGIWYH/pull/428
Solution could be questionable because change validation shems, but works for me
@eitchtee commented on GitHub (Dec 7, 2025):
Thank you for the report and the fix, but I can't seem to reproduce this locally or on a production environment.
Setting category to null raises a 400 error, which makes sense considering the schema, but could probably be changed since categories are indeed nullable.
And GETting a transaction with a null category just works.
Do you have some reproducible curls commands (or something else)?
@SerafimPikalov commented on GitHub (Dec 7, 2025):
I’m out of code right now and can’t test it, but it should be pretty close to these ones:
First, create a transaction without a category:
curl -X POST http://127.0.0.1:9005/api/transactions/
-u "login:pass"
-H "Content-Type: application/json"
-d '{
"account_id": 1,
"date": "2025-02-03",
"amount": "123.45",
"description": "Example purchase",
"type": "EX",
"is_paid": true
}'
Set prexisted category:
curl -X PATCH http://127.0.0.1:9005/api/transactions/1234/
-u "login:pass"
-H "Content-Type: application/json"
-d '{"category": "Groceries"}'
@eitchtee commented on GitHub (Dec 7, 2025):
Yeah, no luck on my side.
However the fix is solid and shouldn't cause any problems.