Skip to content

Conversation

@ahmad-hassan-dev
Copy link
Contributor

Description:
Add a description of your changes here.

Jira:
ENT-XXXX

Merge checklist:

  • ./manage.py makemigrations has been run
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.

Post merge:

  • Ensure that your changes went out to the stage instance
  • Deploy to prod instance

@ahmad-hassan-dev ahmad-hassan-dev force-pushed the ahmad-hassan-dev/ENT-10997 branch from a374d8c to 2b4e3d4 Compare October 14, 2025 16:55
@ahmad-hassan-dev ahmad-hassan-dev marked this pull request as ready for review October 17, 2025 03:23
Copy link
Member

@sameenfatima78 sameenfatima78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 💯 Left a few questions

Comment on lines 75 to 76
raise Exception(f"Consistency Error: Missing assignment for approved request {request.uuid}")
approved_requests_map[request.uuid] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the exceptions consistent, let's raise SubisidyAccessPolicyRequestApprovalError here.

return valid_requests, failed_requests


def can_allocate_all(self, learner_credit_requests):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of creating a new method, let's just move this code into can_approve() or assignment_request_can_allocate if we are relying on any content assignments functionality.

Comment on lines +1990 to +1995
# Verifies that the price on each LearnerCreditRequest is within the
# acceptable tolerance range of its canonical price.
valid_requests, failed_price_requests = self.validate_learner_credit_requests_allocation_prices(
requests_in_catalog, all_metadata
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use validate_requested_allocation_price for handling this?


# If the request has a valid lms_user_id, also check for a match on that.
if request.user.lms_user_id:
sub_query |= Q(lms_user_id=request.user.lms_user_id, content_key=request.course_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed as the a learner submitting a request will always be a valid user.

@ahmad-hassan-dev ahmad-hassan-dev force-pushed the ahmad-hassan-dev/ENT-10997 branch 8 times, most recently from 5a3cecb to a19f4f9 Compare October 28, 2025 10:17
@ahmad-hassan-dev ahmad-hassan-dev force-pushed the ahmad-hassan-dev/ENT-10997 branch 3 times, most recently from f6aa027 to 2414502 Compare October 30, 2025 07:47
@ahmad-hassan-dev ahmad-hassan-dev force-pushed the ahmad-hassan-dev/ENT-10997 branch from 2414502 to be4fc6b Compare October 30, 2025 08:34
@ahmad-hassan-dev ahmad-hassan-dev merged commit c046e01 into main Nov 3, 2025
4 checks passed
@ahmad-hassan-dev ahmad-hassan-dev deleted the ahmad-hassan-dev/ENT-10997 branch November 3, 2025 10:52
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.

3 participants