Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions api/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime, timedelta
from hmac import compare_digest

from decouple import config
from django.conf import settings
Expand Down Expand Up @@ -558,11 +559,12 @@ def take_update_confirm_dispute_cancel(self, request, format=None):
if not valid:
return Response(context, status=status.HTTP_409_CONFLICT)

if order.password is not None and order.password != password:
return Response(
{"bad_request": "Wrong password"},
status=status.HTTP_403_FORBIDDEN,
)
if order.password is not None:
if password is None or not compare_digest(order.password, password):
return Response(
{"bad_request": "Wrong password"},
status=status.HTTP_403_FORBIDDEN,
)

# For order with amount range, set the amount now.
if order.has_range:
Expand Down
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

```
docker compose -f docker-tests.yml --env-file tests/compose.env up -d
docker exec coordinator coverage run manage.py test
docker exec coordinator coverage report
docker exec test-coordinator coverage run manage.py test
docker exec test-coordinator coverage report
```
Loading