🚨(backend) handle new checks introduced in Pylint v3.2.0
Pylint 3.2.0 introduced a new check `possibly-used-before-assignment`, which ensures variables are defined regardless of conditional statements. Some if/else branches were missing defaults. These have been fixed.
This commit is contained in:
committed by
aleb_the_flash
parent
04717fd629
commit
e0739689e6
@@ -23,6 +23,8 @@ def exception_handler(exc, context):
|
|||||||
detail = exc.message
|
detail = exc.message
|
||||||
elif hasattr(exc, "messages"):
|
elif hasattr(exc, "messages"):
|
||||||
detail = exc.messages
|
detail = exc.messages
|
||||||
|
else:
|
||||||
|
detail = ""
|
||||||
|
|
||||||
exc = drf_exceptions.ValidationError(detail=detail)
|
exc = drf_exceptions.ValidationError(detail=detail)
|
||||||
|
|
||||||
|
|||||||
@@ -349,6 +349,8 @@ def test_api_team_invitations__update__forbidden(method):
|
|||||||
|
|
||||||
client = APIClient()
|
client = APIClient()
|
||||||
client.force_login(user)
|
client.force_login(user)
|
||||||
|
|
||||||
|
response = None
|
||||||
if method == "put":
|
if method == "put":
|
||||||
response = client.put(
|
response = client.put(
|
||||||
f"/api/v1.0/teams/{invitation.team.id}/invitations/{invitation.id}/",
|
f"/api/v1.0/teams/{invitation.team.id}/invitations/{invitation.id}/",
|
||||||
@@ -357,6 +359,7 @@ def test_api_team_invitations__update__forbidden(method):
|
|||||||
response = client.patch(
|
response = client.patch(
|
||||||
f"/api/v1.0/teams/{invitation.team.id}/invitations/{invitation.id}/",
|
f"/api/v1.0/teams/{invitation.team.id}/invitations/{invitation.id}/",
|
||||||
)
|
)
|
||||||
|
assert response is not None
|
||||||
assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED
|
assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED
|
||||||
assert response.json()["detail"] == f'Method "{method.upper()}" not allowed.'
|
assert response.json()["detail"] == f'Method "{method.upper()}" not allowed.'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user