Skip to content

fix(backend): fix null margin mappings crashing affinity endpoint#40

Merged
martingaldeca merged 2 commits intomainfrom
fix-backend-issues
Feb 21, 2026
Merged

fix(backend): fix null margin mappings crashing affinity endpoint#40
martingaldeca merged 2 commits intomainfrom
fix-backend-issues

Conversation

@martingaldeca
Copy link
Member

Type of Change

  • 🚀 New feature (non-breaking change which adds functionality)
  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🧹 Chore (technical task, refactoring, maintenance)

Description

Briefly describe the changes made in this Pull Request. Explain the solution and the reasoning.
This PR fixes Internal Server Errors occurring on the /api/answers/completed/.../affinity/ endpoints.
The errors were caused by explicitly null JSON values for margin inputs crashing Pydantic validations during compatibility calculations. The changes gracefully fallback to 0 when encountering these cases during _map_axes.

Related Issue

Closes #

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • Unit Tests
  • Manual Testing

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@martingaldeca martingaldeca merged commit 313d104 into main Feb 21, 2026
3 checks passed
@martingaldeca martingaldeca deleted the fix-backend-issues branch February 21, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant