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

fix: make OrganisationSubscriptionInformationCache.allowed_projects nullable #2716

Merged

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented Aug 31, 2023

Changes

Fixes #2715

Note that null is assumed to mean no project limit (which should be the default for paid SaaS subscriptions).

How did you test this code?

Added unit test

@matthewelwell matthewelwell requested review from a team and novakzaballa August 31, 2023 11:47
@vercel
Copy link

vercel bot commented Aug 31, 2023

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2023 0:09am
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2023 0:09am
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2023 0:09am

@github-actions
Copy link
Contributor

github-actions bot commented Aug 31, 2023

Uffizzi Preview deployment-34913 was deleted.

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2023

Codecov Report

Patch coverage: 92.59% and project coverage change: -0.01% ⚠️

Comparison is base (218df20) 95.47% compared to head (cedad39) 95.47%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2716      +/-   ##
==========================================
- Coverage   95.47%   95.47%   -0.01%     
==========================================
  Files         986      987       +1     
  Lines       27729    27755      +26     
==========================================
+ Hits        26474    26498      +24     
- Misses       1255     1257       +2     
Files Changed Coverage Δ
...grations/0046_allow_allowed_projects_to_be_null.py 83.33% <83.33%> (ø)
api/organisations/models.py 93.63% <100.00%> (ø)
api/organisations/tests/test_views.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -582,6 +583,45 @@ def setUp(self) -> None:
)
self.subscription = Subscription.objects.get(organisation=self.organisation)

@mock.patch("organisations.views.extract_subscription_metadata")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not happy about having to continue to use these class based tests but ripping these up into functional pytest tests would be a fairly large effort that I don't think this PR warrants right now.

Copy link
Contributor

@novakzaballa novakzaballa left a comment

Choose a reason for hiding this comment

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

LGTM

@matthewelwell matthewelwell merged commit 1b37c99 into main Aug 31, 2023
@matthewelwell matthewelwell deleted the fix/chargebee-webhook-allowed_projects-integrity-error branch August 31, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IntegrityError: null value in column "allowed_projects" violates not-null constraint
3 participants