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-W0027f-string
used without any expression307 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 expression303
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 expression243 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 expression239
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:
f-string
used without any expression1215 ).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
It is wasteful to use f-string
mechanism if there are no expressions to be extrapolated. It is recommended to use regular strings instead.