godhar
godhar

Reputation: 1402

Mypy throws invalid syntax on method signature

A method called within the below method triggers mypy to lint with test_get_all_boards: test_get_all_boards invalid syntax mypy(error). The method in question returns a boolean. I just understand what is wrong with the syntax at test_get_all_boards:. Any ideas?

@action(detail=False, methods=["post"])
def try_connection(self, request, *args, **kwargs):
    result = False
    cache = caches["instance_details"]

    if request.data:
        try:
            details = Jira(**request.data)
            if details:
                if cache[details.uuid]['valid_credentials']:
                    result = True
                else test_get_all_boards(details):
                    cache[details.uuid]['valid_credentials'] = True
                    result = True
        except:
            pass

    return Response({"test_result": result}, status=status.HTTP_200_OK)

Upvotes: 0

Views: 306

Answers (1)

jjramsey
jjramsey

Reputation: 1171

There shouldn't be anything between the keyword else and the following ":". Maybe you mean to use elif instead?

Upvotes: 1

Related Questions