Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add validation on subsidy uuid #606

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

muhammad-ammar
Copy link
Contributor

@muhammad-ammar muhammad-ammar commented Dec 4, 2024

Description: Add validation on subsidy uuid.

Jira: https://2u-internal.atlassian.net/browse/ENT-9800

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

@muhammad-ammar muhammad-ammar marked this pull request as draft December 4, 2024 14:47
@muhammad-ammar muhammad-ammar force-pushed the ammar/add-subsidy-uuid-validation branch 3 times, most recently from 47c15f0 to ea29748 Compare December 9, 2024 07:40
@muhammad-ammar muhammad-ammar marked this pull request as ready for review December 9, 2024 07:55
Copy link
Contributor

@iloveagent57 iloveagent57 left a comment

Choose a reason for hiding this comment

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

Good idea! It'd be good to add a couple of unit tests to cover the ValidationErrors getting raised, too.

raise ValidationError("Subsidy does not exist") from exc

if str(subsidy["enterprise_customer_uuid"]) != str(self.cleaned_data["enterprise_customer_uuid"]):
raise ValidationError("Subsidy is not assigned to the same enterprise customer as the budget") from exc
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the from exc, the exc variable won't exist here.

@muhammad-ammar muhammad-ammar force-pushed the ammar/add-subsidy-uuid-validation branch from 00f526c to 41b3817 Compare December 10, 2024 10:10
@muhammad-ammar muhammad-ammar force-pushed the ammar/add-subsidy-uuid-validation branch from 41b3817 to 5c71d0f Compare December 10, 2024 18:21
@muhammad-ammar muhammad-ammar merged commit 4ca1895 into main Dec 11, 2024
3 checks passed
@muhammad-ammar muhammad-ammar deleted the ammar/add-subsidy-uuid-validation branch December 11, 2024 06:40
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.

2 participants