Skip to content

Commit

Permalink
refactor: do not attempt to convert the credential_id to an int
Browse files Browse the repository at this point in the history
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
  • Loading branch information
amanji committed Sep 21, 2024
1 parent eba29f9 commit 3ace5d3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions server/vcr-server/api/v4/views/rest/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ def get_object(self):
raise Http404()

filter = {"credential_id": credential_id}
# If the input parameter is a pure int, treat as an internal database pk
try:
filter = {"pk": int(credential_id)}
except (ValueError, TypeError):
pass

queryset = self.filter_queryset(self.get_queryset())
obj = get_object_or_404(queryset, **filter)
Expand Down

0 comments on commit 3ace5d3

Please sign in to comment.