uselotus / lotus

File .deepsource.toml not found in the default branch of the repository root. Please refer to the docs.

Assert statement used outside of tests BAN-B101
Security
Major
a year agoa year old
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 745    def post(self, request, format=None):
 746        organization = parse_organization(request)
 747        source = request.data["source"]
 748        assert source in [choice[0] for choice in PAYMENT_PROVIDERS.choices] 749        connector = PAYMENT_PROVIDER_MAP[source]
 750        try:
 751            num = connector.import_customers(organization)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 796    def post(self, request, format=None):
 797        organization = parse_organization(request)
 798        source = request.data["source"]
 799        assert source in [choice[0] for choice in PAYMENT_PROVIDERS.choices] 800        connector = PAYMENT_PROVIDER_MAP[source]
 801        try:
 802            num = connector.import_payment_objects(organization)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 849    def post(self, request, format=None):
 850        organization = parse_organization(request)
 851        source = request.data["source"]
 852        assert source in [choice[0] for choice in PAYMENT_PROVIDERS.choices] 853        end_now = request.data.get("end_now", False)
 854        connector = PAYMENT_PROVIDER_MAP[source]
 855        try:
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 500    def validate(self, data):
 501        data = super().validate(data)
 502        rs = data.get("range_start", None)
 503        assert rs is not None and rs >= Decimal(0), "range_start must be >= 0" 504        re = data.get("range_end", None)
 505        if not re:
 506            re = Decimal("Infinity")
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 504        re = data.get("range_end", None)
 505        if not re:
 506            re = Decimal("Infinity")
 507        assert re > rs 508        if data.get("type") == PRICE_TIER_TYPE.FLAT:
 509            assert data.get("cost_per_batch") is not None
 510            data["metric_units_per_batch"] = None