Skip to content

Commit

Permalink
ignore pylint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
SalmanAsh committed Jul 19, 2024
1 parent 1f95859 commit 77e52ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions api/serializers/agreement_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def get_agreement_commit(self, ref: str):
# pylint: disable=line-too-long
url = f"https://api.github.com/repos/{settings.OWNER}/{settings.REPO_NAME}/commits/{ref}"

# Set api version
# header: t.Dict[str, str] = {"X-GitHub-Api-Version:": "2022-11-28"}

# Send an API request
response = requests.get(url, timeout=10)
if not response.ok:
Expand Down
7 changes: 5 additions & 2 deletions api/views/agreement_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def get_queryset(self):

return queryset

# pylint: disable-next=unused-argument
@action(
detail=False,
methods=["get"],
url_path="check-signed/(?P<contributor_pk>.+)",
)
# pylint: disable=unused-argument
def check_signed(self, _, **url_params: str):
"""
Get the latest commit id and compare with contributor's
Expand Down Expand Up @@ -69,7 +69,10 @@ def check_signed(self, _, **url_params: str):

# Compare agreement IDs
if latest_commit_id == latest_signature.agreement_id:
return Response()
return Response(
data={"Outcome:": "Successful"},
status=status.HTTP_200_OK,
)

return Response(
data={"latest_commit_id: ": latest_commit_id},
Expand Down
4 changes: 2 additions & 2 deletions api/views/agreement_signature_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def test_create(self):
self.client.create(
data={
"contributor": 4,
"agreement_id": "4e694741a4501f224435c6adf23dd6f0122ccbf4",
"agreement_id": "81efd9e68f161104071f7bef7f9256e4840c1af7",
"signed_at": "2024-01-02T12:00:00Z",
}
},
)

def test_check_signed(self):
Expand Down

0 comments on commit 77e52ee

Please sign in to comment.