uselotus / lotus

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

f-string used without any expression PTC-W0027
Anti-pattern
Major
a year agoa year old
f-string used without any expression
307            return Response({"detail": msg}, status=status.HTTP_400_BAD_REQUEST)
308        existing_user_num = User.objects.filter(email=email).count()
309        if existing_user_num > 0:
310            msg = f"User with email already exists"311            return Response({"detail": msg}, status=status.HTTP_400_BAD_REQUEST)
312
313        user = setup_demo_3(company_name, username, email, password)
f-string used without any expression
303
304        existing_user_num = User.objects.filter(username=username).count()
305        if existing_user_num > 0:
306            msg = f"User with username already exists"307            return Response({"detail": msg}, status=status.HTTP_400_BAD_REQUEST)
308        existing_user_num = User.objects.filter(email=email).count()
309        if existing_user_num > 0:
f-string used without any expression
243            return Response({"detail": msg}, status=status.HTTP_400_BAD_REQUEST)
244        existing_user_num = User.objects.filter(email=email).count()
245        if existing_user_num > 0:
246            msg = f"User with email already exists"247            return Response({"detail": msg}, status=status.HTTP_400_BAD_REQUEST)
248
249        user = User.objects.create_user(
f-string used without any expression
239
240        existing_user_num = User.objects.filter(username=username).count()
241        if existing_user_num > 0:
242            msg = f"User with username already exists"243            return Response({"detail": msg}, status=status.HTTP_400_BAD_REQUEST)
244        existing_user_num = User.objects.filter(email=email).count()
245        if existing_user_num > 0:
1215        ).count()
1216        if num_existing_subs > 0:
1217            raise serializers.ValidationError(
1218                f"Customer already has an active subscription to this plan"1219            )
1220        # check that if the plan is designed for a specific customer, that the customer is that customer
1221        tc = data["billing_plan"].plan.target_customer