Skip to content

Conversation

@marcoacierno
Copy link
Member

@marcoacierno marcoacierno commented Jul 27, 2025

Fixes #4408

Summary

  • Fixed issue where confirmed grants still showed as pending in waiting list
  • Changed pending_status logic: None = no pending change, set value = pending status
  • Removed problematic sync logic that was causing the issue

Test plan

  • Run existing grant tests
  • Create and run database migration
  • Test admin interface for grant status changes
  • Test grant confirmation flow

Change pending_status field logic:
- pending_status=None means no pending change (use current status)
- pending_status=value means there''s a pending status change

This fixes the issue where confirmed grants still showed as pending.

Changes:
- Modified Grant.pending_status field to allow null values
- Removed problematic sync logic in save() method
- Updated _calculate_grant_amounts to use effective status
- Updated admin queries and actions to work with new logic
- Updated tests to reflect new behavior

Co-authored-by: Marco Acierno <[email protected]>
@vercel
Copy link

vercel bot commented Jul 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
pycon ✅ Ready (Inspect) Visit Preview Aug 3, 2025 5:37pm

@codecov
Copy link

codecov bot commented Jul 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.53%. Comparing base (9a8117f) to head (6a859d7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4431   +/-   ##
=======================================
  Coverage   94.53%   94.53%           
=======================================
  Files         352      352           
  Lines       10130    10131    +1     
  Branches      734      733    -1     
=======================================
+ Hits         9576     9577    +1     
  Misses        461      461           
  Partials       93       93           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marcoacierno
Copy link
Member Author

@claude test_reset_pending_status_back_to_status_action is failing as it needs to be updated with the new logic

        assert grant_1.status == Grant.Status.pending
>       assert grant_1.pending_status == Grant.Status.pending
E       AssertionError: assert None == Grant.Status.pending
E        +  where None = <Grant: Joseph Carter>.pending_status
E        +  and   Grant.Status.pending = <enum 'Status'>.pending
E        +    where <enum 'Status'> = Grant.Status

@claude
Copy link
Contributor

claude bot commented Jul 27, 2025

Claude finished @marcoacierno's task —— View job


Fixing failing test test_reset_pending_status_back_to_status_action

Todo List:

  • Read the failing test to understand current logic
  • Read the updated grant models to understand new pending_status behavior
  • Update test assertions to match new logic (None = no pending change)
  • Commit and push the fix

✅ Fixed!

Updated the test assertions in backend/grants/tests/test_admin.py:527-533 to expect pending_status=None instead of expecting it to match the status value.

The Issue: The admin action reset_pending_status_back_to_status now sets pending_status=None (meaning "no pending change"), but the test was still expecting pending_status to equal the status value.

The Fix: With the new logic:

  • pending_status=None → use current status (no pending change)
  • pending_status=value → pending status overrides current status

The test now correctly expects pending_status to be None after the reset action runs.

Commit: 49b25b0 - Fix test_reset_pending_status_back_to_status_action for new pending_status logic


…tatus logic

Update test assertions to expect pending_status=None after reset action,
which aligns with the new logic where None means no pending change.

Co-authored-by: Marco Acierno <[email protected]>
@marcoacierno marcoacierno marked this pull request as ready for review August 2, 2025 21:32
@marcoacierno marcoacierno merged commit f8a87d3 into main Aug 3, 2025
7 checks passed
@marcoacierno marcoacierno deleted the claude/issue-4408-20250727-1301 branch August 3, 2025 17:46
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.

When a grantee confirms his grant the Pending status is not updated

2 participants