uselotus / lotus

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

Unnecessary else / elif used after return PYL-R1705
Style
Major
a year agoa year old
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
 604    )
 605    def get(self, request, format=None):
 606        result, success = fast_api_key_validation_and_cache(request)
 607        if not success: 608            return result
 609        else:
 610            organization_pk = result
Unnecessary "elif" after "return", remove the leading "el" from "elif"
143        stream_events = {"events": events, "organization_id": organization_pk}
144        kafka_producer.produce(customer_id, stream_events)
145
146    if len(bad_events) == len(event_list):147        return Response(
148            {"success": "none", "failed_events": bad_events},
149            status=status.HTTP_400_BAD_REQUEST,
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
 93@permission_classes([])
 94def track_event(request):
 95    result, success = fast_api_key_validation_and_cache(request)
 96    if not success: 97        return result
 98    else:
 99        organization_pk = result
Unnecessary "elif" after "return", remove the leading "el" from "elif"
 551        return response
 552
 553    def get_serializer_class(self):
 554        if self.action == "retrieve": 555            return PlanDetailSerializer
 556        elif self.action == "partial_update":
 557            return PlanUpdateSerializer
Unnecessary "elif" after "return", remove the leading "el" from "elif"
 655            )
 656
 657    def get_serializer_class(self):
 658        if self.action == "partial_update": 659            return SubscriptionUpdateSerializer
 660        elif self.action == "retrieve":
 661            return SubscriptionDetailSerializer