eee02a3403
An additional check for whether customer.stripe_customer_id is None is added to the function. That check was not really required before since all the customers with a plan also have a valid value for stripe_customer_id. So all the calls to stripe.Invoice.list would have non None value for customer argument. Even though that is the case, mypy should still have complained about the possibility of customer.stripe_customer_id being None when passed to stripe.Invoice.list as customer paramater since mypy don't know that customers with a plan will always have a non empty value for stripe_customer_id. Our stripe stubs expect a non empty value for the customer parameter of stripe.Invoice.list. This is despite the fact that stripe.Invoice.list can actually be called with customer set to None. This returns the invoices from the entire organization. Though, we still decided to ensure that the value of customer should be non empty since there is no reason for us to ever call this function with customer set to None. You can just call the function wuthout the customer argument instead. So this requirement of a non None customer paramater is useful for catching bugs. The reason mypy didn't complain was because the type of Customer.objects.all() is Any and not QuerySet[Customer]. So mypy has no idea that customer.stripe_customer_id can be theoratically None even though it was not possible in this [articular case as explained before. I verified that this was the reason mypy didn't complain by using the reveal_type function on Customer.objects.all() and the customer object. After the refactoring it's super to obvious to mypy that the type of the customer is Customer since it's mentioned in the function defintion. So it was able to complain about the possibility of customer.stripe_customer_id being None after the refactoring. |
||
---|---|---|
.github | ||
.tx | ||
analytics | ||
confirmation | ||
corporate | ||
docs | ||
frontend_tests | ||
locale | ||
pgroonga | ||
puppet | ||
requirements | ||
scripts | ||
static | ||
stubs | ||
templates | ||
tools | ||
var/puppeteer | ||
zerver | ||
zilencer | ||
zproject | ||
.browserslistrc | ||
.codecov.yml | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.json | ||
.gitattributes | ||
.gitignore | ||
.gitlint | ||
.mailmap | ||
.npmignore | ||
.prettierignore | ||
.pyre_configuration | ||
.sonarcloud.properties | ||
.yarnrc | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
Dockerfile-postgresql | ||
LICENSE | ||
NOTICE | ||
README.md | ||
SECURITY.md | ||
Vagrantfile | ||
babel.config.js | ||
manage.py | ||
package.json | ||
postcss.config.js | ||
prettier.config.js | ||
pyproject.toml | ||
setup.cfg | ||
stylelint.config.js | ||
tsconfig.json | ||
version.py | ||
webpack.config.ts | ||
yarn.lock |
README.md
Zulip overview
Zulip is a powerful, open source group chat application that combines the immediacy of real-time chat with the productivity benefits of threaded conversations. Zulip is used by open source projects, Fortune 500 companies, large standards bodies, and others who need a real-time chat system that allows users to easily process hundreds or thousands of messages a day. With over 700 contributors merging over 500 commits a month, Zulip is also the largest and fastest growing open source group chat project.
Getting started
Click on the appropriate link below. If nothing seems to apply, join us on the Zulip community server and tell us what's up!
You might be interested in:
-
Contributing code. Check out our guide for new contributors to get started. Zulip prides itself on maintaining a clean and well-tested codebase, and a stock of hundreds of beginner-friendly issues.
-
Contributing non-code. Report an issue, translate Zulip into your language, write for the Zulip blog, or give us feedback. We would love to hear from you, even if you're just trying the product out.
-
Supporting Zulip. Advocate for your organization to use Zulip, become a sponsor, write a review in the mobile app stores, or upvote Zulip on product comparison sites.
-
Checking Zulip out. The best way to see Zulip in action is to drop by the Zulip community server. We also recommend reading Zulip for open source, Zulip for companies, or Zulip for communities.
-
Running a Zulip server. Use a preconfigured DigitalOcean droplet, install Zulip directly, or use Zulip's experimental Docker image. Commercial support is available; see https://zulip.com/plans for details.
-
Using Zulip without setting up a server. https://zulip.com offers free and commercial hosting, including providing our paid plan for free to fellow open source projects.
-
Participating in outreach programs like Google Summer of Code.
You may also be interested in reading our blog or following us on Twitter. Zulip is distributed under the Apache 2.0 license.