Skip to content

Commit cb6f2c1

Browse files
cclausspaul121
authored andcommitted
Use ==/!= to compare constant literals (str, bytes, int, float, tuple)
1 parent 6f6bd5c commit cb6f2c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/app/app/routers/utils/farms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ def get_farm_client(db, farm, version=2):
262262

263263
# Raise an error if the API endpoint doesn't match the server version.
264264
# The length of the access tokens differs between 1.x and 2.x
265-
if len(token.access_token) < 60 and version is 2:
265+
if len(token.access_token) < 60 and version == 2:
266266
error = "Server is running farmOS 1.x. Use the /api/v1/farms endpoint."
267267
raise ClientError(error)
268-
elif len(token.access_token) > 60 and version is 1:
268+
elif len(token.access_token) > 60 and version == 1:
269269
error = "Server is running farmOS 2.x. Use the /api/v2/farms endpoint."
270270
raise ClientError(error)
271271

0 commit comments

Comments
 (0)